generated from kea-dev/dx-intro
-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (42 loc) · 1.49 KB
/
template.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
45
46
47
48
49
name: Initial commit workflow
on:
push:
branches:
- '**'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
permissions:
checks: write
actions: write
contents: write
issues: write
jobs:
cpissues:
name: "Initial commit only"
runs-on: ubuntu-latest
if: ${{ contains(github.event.head_commit.message, 'Initial commit') }}
steps:
- name: "Checkout"
uses: actions/checkout@v3
- name: "Raise semaphore or quit"
run: |
if $(gh workflow disable template.yml); then
echo ::notice title=Workflow successfully disabled::This also works as a raised semaphore - parallel workflow runs will see it and cancel
else
echo "::warning title=Another job got here first::This room is crowded - I'm outta here!"
curl -X POST \
-H "Accept: application/vnd.github.v3+json" \
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
https://api.github.com/repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/cancel
exit 1
fi
- name: "Copying issues over"
run: .github/template/cpissues.sh
- name: "Set the README"
run: |
cp .github/template/README.md .
git config --global user.email "[email protected]"
git config --global user.name "The GitHub Action Bot"
git add .
git commit -m "Updated the README"
git push origin