-
-
Notifications
You must be signed in to change notification settings - Fork 3
49 lines (38 loc) · 1.6 KB
/
haskell-updates-status.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: "Haskell Updates Status"
on:
schedule:
# * is a special character in YAML so you have to quote this string
# Update every 6 hours
- cron: '0 */6 * * *'
# Allow manually starting the GitHub Action from the browser. This is nice for
# testing. You can manually start the workflow by clicking the "Run workflow" button on
# https://github.com/cdepillabout/nix-haskell-updates-status/actions/workflows/haskell-updates-status.yml
workflow_dispatch:
inputs: {}
jobs:
update:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v26
- uses: DeterminateSystems/magic-nix-cache-action@v4
- name: Run ./update.sh
run: |
# Create the updated README.md using the script from this checkout.
./update.sh
mv README.md ../README.md-new
- name: Update README.md on main branch
run: |
# Set GitHub Actions Bot email address and user name.
git config --global user.name 'github-actions'
git config --global user.email '41898282+github-actions[bot]@users.noreply.github.com'
# Get the current commit that we are running this workflow from.
commit=$(git rev-parse --short HEAD)
# Checkout the remote main branch.
git fetch
git reset --hard origin/main
# Check in our new README.md file and push it to the remote main branch.
mv ../README.md-new ./README.md
git add README.md
git commit -m "Updated README.md from update.sh at ${commit}"
git push origin HEAD:main