From 129c487f4a05651c64d162f2ba4b4d153958b943 Mon Sep 17 00:00:00 2001 From: "Matthew C. Morgan" Date: Wed, 23 Oct 2024 22:36:19 -0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=92=9A=20ci(action):=20add=20release=20ac?= =?UTF-8?q?tion=20for=20testing?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/release.yml | 53 +++++++++++++++++++++++++++-------- 1 file changed, 42 insertions(+), 11 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 68681af..c8ead3b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,27 +1,35 @@ -# CSVD/release-tag -name: Release Tag +# SCT-Engineering/release action +name: Do Release of Module # Controls when the workflow will run on: + pull_request: + types: [opened, reopened, synchronize, labeled, unlabeled] push: branches: - main # Allows you to run this workflow manually from the Actions tab workflow_dispatch: -permissions: write-all +permissions: + id-token: write + contents: write + pull-requests: write + # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: - # This workflow contains a single job called "build" - Tag: + # This workflow contains a single job called "Release" + Release: # The type of runner that the job will run on runs-on: ["229685449397"] + if: "!startsWith(github.event.head_commit.message, 'bump:')" steps: - uses: CSVD/gh-actions-checkout@v4 id: checkout with: - persist-credentials: false + token: "${{ secrets.PERSONAL_ACCESS_TOKEN }}" + fetch-depth: 0 - name: Setup GITHUB Credentials id: github_credentials @@ -31,9 +39,32 @@ jobs: github_app_installation_id: ${{ vars.GH_APP_INSTALLATION_ID }} github_base_url: "${{ github.server_url }}/" - - name: Tag Release - uses: CSVD/release-tag@main + - name: Create bump and changelog + uses: CSVD/commitizen-action@main with: - patch: true - env: - GITHUB_TOKEN: ${{ steps.github_credentials.outputs.github_token }} + github_token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} + changelog_increment_filename: body.md + + - uses: CSVD/gh-actions-checkout@v4 + - run: | + date > generated.txt + # Note: the following account information will not work on GHES + git config user.name "github-actions[bot]" + git config user.email "{user.id}+{user.login}@users.noreply.github.e.it.census.gov" + git add . + git commit -m "generated" + git push + # - name: Push doc to Github Page + # uses: peaceiris/actions-gh-pages@v4 + # with: + # personal_token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} + # publish_branch: gh-pages + # publish_dir: ./site + # user_name: "github-actions[bot]" + # user_email: "github-actions[bot]@users.noreply.github.com" + # - name: Release + # uses: ncipollo/release-action@v1 + # with: + # tag: v${{ env.REVISION }} + # bodyFile: "body.md" + # skipIfReleaseExists: true