Skip to content

Auto-version

Auto-version #1216

Workflow file for this run

on:
workflow_dispatch:
schedule:
- cron: "30 2 * * *"
name: Auto-version
jobs:
auto-version:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Init Hermit
run: ./bin/hermit env -r >> $GITHUB_ENV
- name: Auto-version
env:
GITHUB_TOKEN: ${{ secrets.AUTO_VERSIONING }}
run: |
set -xe
# Clear out and then re-add HashiCorp package digests because they
# frequently change due to binaries being republished every few months
# Examples:
# https://status.hashicorp.com/incidents/xbbwr755y78b
# https://status.hashicorp.com/incidents/f7bz2z28w6pv
# NOTE: Disabled because this should no longer be necessary.
# grep --files-with-matches --fixed-strings 'releases.hashicorp.com' *.hcl | while read -r file; do
# sed -i~ -E -e '/[a-fA-F0-9]{64}/d' $file
# hermit manifest add-digests $file
# done
hermit -d manifest auto-version --continue-on-error --update-digests *.hcl
if git diff --exit-code HEAD; then
echo "No change"
exit 0
fi
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
git commit -am "Auto-versioned: $(git diff --name-only | paste -s -d ' ' -)"
git push