-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathaction.yml
More file actions
45 lines (37 loc) · 1.16 KB
/
action.yml
File metadata and controls
45 lines (37 loc) · 1.16 KB
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
45
name: Update Devcontainer Hash
inputs:
branch:
description: 'Branch to checkout and update'
required: true
permissions:
contents: write
runs:
using: composite
steps:
- name: Verify Dependabot actor
if: ${{ github.actor != 'dependabot[bot]' }}
run: |
echo "Action can only be run by dependabot[bot], but was invoked by ${GITHUB_ACTOR}." >&2
exit 1
- name: Checkout code
uses: actions/checkout@v4.2.2
with:
persist-credentials: true
fetch-depth: 1
ref: ${{ inputs.branch }}
- name: Configure Git author
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
- name: Update devcontainer hash
run: |
python3 .github/workflows/hash_git_files.py . --for-devcontainer-config-update --exit-zero
- name: Commit & push changes
run: |
if ! git diff --quiet; then
git add .
git commit -m "chore: update devcontainer hash [dependabot skip]"
git push origin HEAD:${{ inputs.branch }}
else
echo "No changes to commit"
fi