-
Notifications
You must be signed in to change notification settings - Fork 0
/
.github-upgrade-check.yml.sample
68 lines (57 loc) · 2.33 KB
/
.github-upgrade-check.yml.sample
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# This workflow compares a downstream azimuth-config repository for a specific site with the upstream
# stackhpc/azimuth-config repository to check whether there is a new upstream version available. If a
# newer tag is found in the upstream repository then a pull request is created to the downstream repo
# in order to merge in the changes from the new upstream release.
# To use this workflow in a downstream azimuth-config repository simply copy it into .github/workflows
# and give it an appropriate name, e.g.
# cp .github-upgrade-check.yml.sample .github/workflows/upgrade-check.yml
name: Check for upstream updates
on:
schedule:
- cron: "0 9 * * *"
workflow_dispatch:
jobs:
check_for_update:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- name: Checkout the config repo
uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true
# Based on equivalent GitLab CI job
- name: Check for new release
shell: bash
run: |
set -xe
# Install dependency
apt update && apt install -y git-crypt
# Tell git who we are for commits
git config user.email "${{ github.actor }}-ci@azimuth.ci"
git config user.name "${{ github.actor }} CI"
# Create the merge branch and write vars to .mergeenv file
./bin/create-merge-branch
- name: Set release tag output
id: release_tag
if: ${{ hashFiles('.mergeenv') }}
run: source .mergeenv && echo value=$RELEASE_TAG >> $GITHUB_OUTPUT
- name: Set branch name output
id: branch_name
if: ${{ hashFiles('.mergeenv') }}
run: source .mergeenv && echo value=$BRANCH_NAME >> $GITHUB_OUTPUT
- name: Remove tmp file
run: rm .mergeenv
if: ${{ hashFiles('.mergeenv') }}
- name: Create Pull Request
if: ${{ steps.release_tag.outputs.value }}
uses: peter-evans/create-pull-request@v6
with:
base: main
branch: ${{ steps.branch_name.outputs.value }}
title: "Upgrade Azimuth to ${{ steps.release_tag.outputs.value }}"
body: This PR was automatically generated by GitHub Actions.
commit-message: "Upgrade Azimuth to ${{ steps.release_tag.outputs.value }}"
delete-branch: true