Skip to content

Sl/chore/can 7656/can 7679 #1

Sl/chore/can 7656/can 7679

Sl/chore/can 7656/can 7679 #1

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

View workflow run for this annotation

GitHub Actions / .github/workflows/dependabot-new-pr.yml

Invalid workflow file

error parsing called workflow ".github/workflows/dependabot-new-pr.yml" -> "livelyhood/cove-workflows/.github/workflows/notify.yml@main" : workflow was not found. See https://docs.github.com/actions/learn-github-actions/reusing-workflows#access-to-reusable-workflows for more information.
needs:
- dependabot
if: ${{ always() && contains(needs.*.result, 'failure') }}
secrets: inherit
with:
failure: true