diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 519e612..3bdc961 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,6 +1,10 @@ name: Build SMPTE document -on: [push, pull_request] +on: + push: + pull_request: + release: + types: [published] env: AWS_REGION: us-east-1 @@ -11,7 +15,12 @@ env: jobs: build: runs-on: ubuntu-latest - if: (github.event_name == 'push' && github.ref == 'refs/heads/main') || github.event_name == 'pull_request' + if: > + github.repository_owner == 'SMPTE' && ( + (github.event_name == 'push' && github.ref == 'refs/heads/main') + || github.event_name == 'pull_request' + || github.event_name == 'release' + ) # These permissions are needed to interact with GitHub's OIDC Token endpoint. permissions: id-token: write @@ -24,14 +33,13 @@ jobs: uses: actions/checkout@v3 with: fetch-depth: 0 - ref: ${{ github.event.pull_request.head.sha }} submodules: true - name: Set repository name run: echo "REPOSITORY_NAME=${GITHUB_REPOSITORY#*/}" >> $GITHUB_ENV - name: Check out all branches with the exception of the current branch - run: CUR_BRANCH=$(git rev-parse --abbrev-ref HEAD); for i in `git branch -a | grep remote | grep -v HEAD | grep -v ${CUR_BRANCH}`; do git branch --track ${i#remotes/origin/} $i; done + run: CUR_BRANCH=$(git rev-parse --abbrev-ref HEAD); for i in `git branch -a | grep remote | grep -v "remotes/pull" | grep -v HEAD | grep -v ${CUR_BRANCH}`; do git branch --track ${i#remotes/origin/} $i; done - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v1-node16