Skip to content

Update devcontainer feature versions #35

Update devcontainer feature versions

Update devcontainer feature versions #35

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