Merge pull request #26 from pbs/updates_from_template #22
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release | |
on: | |
push: | |
branches: [ main ] | |
concurrency: release-${{ github.base_ref }} | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@main | |
- name: Setup rtx | |
uses: jdx/rtx-action@v1 | |
- name: "Run document script if necessary" | |
run: | | |
if [[ "$(basename "$(git rev-parse --show-toplevel)")" != *'terraform-aws-template'* ]]; then | |
./scripts/document.sh | |
echo "Setting core.fileMode to false to avoid false positives in documentation check." | |
git config core.fileMode false | |
if [[ -n $(git status --porcelain) ]]; then | |
echo "Documentation is not up to date. Comitting updates" | |
git add README.md | |
git config user.name "${GITHUB_USERNAME}" | |
git config user.email "${GITHUB_USERNAME}@users.noreply.github.com" | |
git commit -m "Running document script" | |
fi | |
fi | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
GITHUB_USERNAME: ${{ github.actor }} | |
- name: Release | |
run: ./scripts/release.sh | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
GITHUB_USERNAME: ${{ github.actor }} |