Skip to content

debug

debug #8

Workflow file for this run

name: Post Push
on:
push:
branches:
- main
- master
tags:
- '*'
permissions: write-all
jobs:
post-push:
runs-on: ubuntu-latest
steps:
- name: get-default-branch
run: |
branch=$(curl -s "https://api.github.com/repos/$GITHUB_REPOSITORY" | jq -r '.default_branch')
echo "default_branch=$branch" >> $GITHUB_ENV
- uses: 8BitJonny/gh-get-current-pr@2215326c76d51bfa3f2af0a470f32677f6c0cae9 # v2.2.0
id: PR
- name: checkout
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 #v3.6.0
with:
ref: ${{ env.default_branch }}
fetch-depth: 0
- name: Setup upterm session
uses: lhotari/action-upterm@v1
- name: init
run: |
docker run --rm -v $(pwd):/src -w /src mcr.microsoft.com/azterraform:latest make generate
- name: Yor Tag
id: yor-tag
run: |
docker run --rm -v $(pwd):/src -w /src mcr.microsoft.com/azterraform:latest make yor-tag
- name: update-changelog
run: |
MAJOR_VERSION=$(ls | grep CHANGELOG | cut -d'-' -f 2 | cut -f 1 -d '.' | grep v | sort -V -r | head -n 1)
if [ -z "$MAJOR_VERSION" ]; then
MAJOR_VERSION=0
else
MAJOR_VERSION=${MAJOR_VERSION#"v"}
MAJOR_VERSION=$((MAJOR_VERSION+1))
fi
previous_tag=$(docker run -e MAJOR_VERSION=$MAJOR_VERSION --rm mcr.microsoft.com/azterraform:latest previousTag ${{ github.repository_owner }} ${{ github.event.repository.name }} $MAJOR_VERSION.0.0)
if [ -z $previous_tag ]; then
docker run --rm -v $(pwd):/src -w /src githubchangeloggenerator/github-changelog-generator -u ${{ github.repository_owner }} -p ${{ github.event.repository.name }} -t ${{ secrets.GITHUB_TOKEN }} --no-issues --no-compare-link
else
docker run --rm -v $(pwd):/src -w /src githubchangeloggenerator/github-changelog-generator -u ${{ github.repository_owner }} -p ${{ github.event.repository.name }} -t ${{ secrets.GITHUB_TOKEN }} --no-issues --no-compare-link --since-tag=$previous_tag
fi
sudo chmod -R ugo+rwX .
- name: Download TestVersionSnapshot
id: download-test-version-snapshot-artifact
uses: dawidd6/action-download-artifact@268677152d06ba59fcec7a7f0b5d961b6ccd7e1e # v2.28.0
if: ${{ steps.PR.outputs.number != '' }}
with:
github_token: ${{secrets.GITHUB_TOKEN}}
pr: ${{ steps.PR.outputs.number }}
workflow: acc-test.yaml
name: TestRecord-${{ steps.PR.outputs.number }}
path: TestRecord
if_no_artifact_found: ignore
- name: Update Test Record
if: ${{ steps.PR.outputs.number != '' }}
run: |
sh scripts/update-test-record.sh
- name: AutoFix
id: autofix
run: |
docker run --rm -v $(pwd):/src -w /src mcr.microsoft.com/azterraform:latest make autofix
- name: Terraform Validate
id: terraform-validate
run: |
docker run --rm -v $(pwd):/src -w /src mcr.microsoft.com/azterraform:latest sh -c "make pre-commit && make pr-check"
- name: Commit & Push changes
uses: actions-js/push@156f2b10c3aa000c44dbe75ea7018f32ae999772 # v1.4
if: ${{ github.repository != 'Azure/terraform-verified-module' }}
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
message: 'Auto update'
branch: ${{ env.default_branch }}