Sl/chore/can 7656/can 7679 #1
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Dependabot New PR | ||
on: | ||
pull_request: | ||
types: | ||
- opened | ||
- reopened | ||
jobs: | ||
dependabot: | ||
runs-on: ubuntu-latest | ||
if: github.actor == 'dependabot[bot]' | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: read maintainers.json | ||
id: read-maintainers | ||
# reads maintainers array and map them to their slack userIds "mentions" (see slack api https://api.slack.com/reference/surfaces/formatting#mentioning-users) | ||
run: | | ||
# shellcheck disable=SC2002 | ||
echo "maintainers=$(cat maintainers.json | jq '.[] | to_entries | .[].value' | jq --slurp -r '. | join(" ")')" >> "$GITHUB_OUTPUT" | ||
- name: 'Post PR to #dev-pr' | ||
if: always() # continue even if read-maintainers failed for some reason | ||
uses: slackapi/[email protected] | ||
env: | ||
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} | ||
MAINTAINERS: ${{ steps.read-maintainers.outputs.maintainers }} | ||
with: | ||
channel-id: C0399MY1YKW # dev-pr channel | ||
payload: | | ||
{ | ||
"attachments": [ | ||
{ | ||
"mrkdwn_in": ["text"], | ||
"color": "#3679a6", | ||
"author_name": "Dependabot 🤖", | ||
"author_icon": "https://manage.cove.is/imgs/favicon.png", | ||
"title": "${{ github.event.pull_request.title }}", | ||
"title_link": "${{ github.event.pull_request.html_url }}", | ||
"fields": | ||
[ | ||
{ | ||
"title": "repository", | ||
"value": "${{ github.event.pull_request.head.repo.name }} ", | ||
"short": false | ||
}, | ||
{ | ||
"title": "maintainers", | ||
"value": "${{ env.MAINTAINERS || 'no one' }}", | ||
"short": true | ||
} | ||
], | ||
"thumb_url": "https://manage.cove.is/imgs/favicon.png", | ||
} | ||
] | ||
} | ||
############################################# | ||
notify-all: | ||
############################################# | ||
uses: livelyhood/cove-workflows/.github/workflows/notify.yml@main | ||
Check failure on line 57 in .github/workflows/dependabot-new-pr.yml GitHub Actions / .github/workflows/dependabot-new-pr.ymlInvalid workflow file
|
||
needs: | ||
- dependabot | ||
if: ${{ always() && contains(needs.*.result, 'failure') }} | ||
secrets: inherit | ||
with: | ||
failure: true |