-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (44 loc) · 1.56 KB
/
release.yml
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
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 asdf
uses: asdf-vm/actions/setup@v2
- name: Cache asdf
id: asdf-cache
uses: actions/cache@v3
with:
path: ~/.asdf/
key: ${{ runner.os }}-${{ hashFiles('**/.tool-versions') }}
- name: Setup asdf
if: steps.asdf-cache.outputs.cache-hit != 'true'
uses: asdf-vm/actions/install@v2
- 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 }}