generated from ministryofjustice/template-repository
-
Notifications
You must be signed in to change notification settings - Fork 20
44 lines (40 loc) · 1.55 KB
/
generate-dependabot-file.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
name: Generate dependabot file
on:
schedule:
- cron: "40 22 * * 6"
push:
branches:
- main
paths:
- '.github/workflows/generate-dependabot-file.yml'
- 'scripts/generate-dependabot-file.sh'
workflow_dispatch:
defaults:
run:
shell: bash
permissions:
contents: read
jobs:
create-and-commit-dependabot-file:
permissions:
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Generate file
run: bash ./scripts/generate-dependabot-file.sh
- name: Commit changes to GitHub
run: bash ./scripts/git-setup.sh
- run: bash ./scripts/git-commit.sh .github
- run: bash ./scripts/git-pull-request.sh dependabot
env:
SECRET: ${{ secrets.GITHUB_TOKEN }}
- name: Slack failure notification
uses: slackapi/slack-github-action@e28cf165c92ffef168d23c5c9000cffc8a25e117 # v1.24.0
with:
payload: |
{"blocks":[{"type": "section","text": {"type": "mrkdwn","text": ":no_entry: Failed GitHub Action:"}},{"type": "section","fields":[{"type": "mrkdwn","text": "*Workflow:*\n<${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|${{ github.workflow }}>"},{"type": "mrkdwn","text": "*Job:*\n${{ github.job }}"},{"type": "mrkdwn","text": "*Repo:*\n${{ github.repository }}"}]}]}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK
if: ${{ failure() }}