-
Notifications
You must be signed in to change notification settings - Fork 33
45 lines (38 loc) · 1.45 KB
/
update-features.yaml
File metadata and controls
45 lines (38 loc) · 1.45 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 feature versions
on:
workflow_dispatch:
schedule:
- cron: "0 7 * * 1" # 7AM UTC every Monday
jobs:
update-features:
if: ${{ github.ref == 'refs/heads/master' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Update Features
run: |
npm i -g @devcontainers/cli
./feature-versions/update.sh
- name: Create PR for feature updates
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
set -o errexit
# Configure git and Push updates
git config --global user.email github-actions[bot]@users.noreply.github.com
git config --global user.name github-actions[bot]
git config pull.rebase false
branch=automated-feature-update-$GITHUB_RUN_ID
git checkout -b $branch
# Add / update and commit
git add src
git add feature-versions/state.json
if git commit -m 'Automated feature update'; then
# Push
git push origin "${branch}"
gh pr create \
--base master \
--head "${branch}" \
--title "Automated devcontainer feature update" \
--body "This PR was automatically generated by the [update-features.yaml](https://github.com/verily-src/workbench-app-devcontainers/blob/master/.github/workflows/update-features.yaml) workflow."
fi