From b74e5b8a9c119c568af2c4f930faf7e101799de7 Mon Sep 17 00:00:00 2001 From: MaksimZhukov Date: Thu, 27 May 2021 15:07:37 +0300 Subject: [PATCH 1/2] Automate releasing new versions of the setup-java action --- .../workflows/release-new-action-version.yml | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 .github/workflows/release-new-action-version.yml diff --git a/.github/workflows/release-new-action-version.yml b/.github/workflows/release-new-action-version.yml new file mode 100644 index 000000000..daa179ffa --- /dev/null +++ b/.github/workflows/release-new-action-version.yml @@ -0,0 +1,28 @@ +name: Release new action version +on: + release: + types: [released] + workflow_dispatch: + inputs: + TAG_NAME: + description: 'Tag name that the major tag will point to' + required: true + +env: + TAG_NAME: ${{ github.event.inputs.TAG_NAME || github.event.release.tag_name }} + +jobs: + update_tag: + name: Update the major tag to include the ${{ github.event.inputs.TAG_NAME || github.event.release.tag_name }} changes + environment: + name: releaseNewActionVersion + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - name: Update the ${{ env.TAG_NAME }} tag + id: update-major-tag + uses: actions/publish-action@v0.1.0 + with: + source-tag: ${{ env.TAG_NAME }} + slack-webhook: ${{ secrets.SLACK_WEBHOOK }} \ No newline at end of file From 3f4ca863bc1a8c1615fcae28d71eb10c5cdb80a8 Mon Sep 17 00:00:00 2001 From: MaksimZhukov Date: Thu, 27 May 2021 16:19:54 +0300 Subject: [PATCH 2/2] Use permissions as a top-level key --- .github/workflows/release-new-action-version.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release-new-action-version.yml b/.github/workflows/release-new-action-version.yml index daa179ffa..b14c183bf 100644 --- a/.github/workflows/release-new-action-version.yml +++ b/.github/workflows/release-new-action-version.yml @@ -10,6 +10,8 @@ on: env: TAG_NAME: ${{ github.event.inputs.TAG_NAME || github.event.release.tag_name }} +permissions: + contents: write jobs: update_tag: @@ -17,8 +19,6 @@ jobs: environment: name: releaseNewActionVersion runs-on: ubuntu-latest - permissions: - contents: write steps: - name: Update the ${{ env.TAG_NAME }} tag id: update-major-tag