From 42b0c6f884b4ad104c2e5aef784a9ebb522a2680 Mon Sep 17 00:00:00 2001 From: Hannes Wellmann Date: Thu, 12 Sep 2024 18:51:21 +0200 Subject: [PATCH] [FIXUP] --- .github/workflows/checkVersions.yml | 20 ++----------- .../workflows/publishVersionCheckResults.yml | 28 +++++++++---------- 2 files changed, 17 insertions(+), 31 deletions(-) diff --git a/.github/workflows/checkVersions.yml b/.github/workflows/checkVersions.yml index 28972b4d697..e7aaa15abb9 100644 --- a/.github/workflows/checkVersions.yml +++ b/.github/workflows/checkVersions.yml @@ -22,9 +22,7 @@ on: required: false #TODO: revise inputs once done -permissions: - contents: read - issues: write +permissions: read-all jobs: versions-check-and-increment: @@ -32,6 +30,8 @@ jobs: if: github.event_name == 'pull_request' runs-on: ubuntu-latest steps: + - name: Dump GitHub context + run: echo '${{ toJSON(github) }}' - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 #with: @@ -81,20 +81,9 @@ jobs: git status git commit -m "Bump version(s) for ${streamVersion} stream" - #fileList=$(git diff-tree --no-commit-id --name-only HEAD -r) - #echo "file-list<> $GITHUB_OUTPUT - #echo "$fileList" >> $GITHUB_OUTPUT - #echo "EOF" >> $GITHUB_OUTPUT git format-patch -1 HEAD --no-stat --output 'version_increments.patch' # --no-prefix - #git remote add 'fork' https://github.com/${{ github.event.pull_request.head.repo.full_name }}.git - #git remote -v - #git push 'fork' 'HEAD:refs/heads/${{ github.event.pull_request.head.ref }}' - #git push \ - # "https://oauth2:${BOT_TOKEN}@github.com/${{ github.event.pull_request.head.repo.full_name }}.git" \ - # 'HEAD:refs/heads/${{ github.event.pull_request.head.ref }}' - else echo 'No versions have to be incremented' fi @@ -103,6 +92,3 @@ jobs: with: name: versions-git-patch path: version_increments.patch - -# TODO: Add an FAQ about version bumps? -# TODO: make comment updatable \ No newline at end of file diff --git a/.github/workflows/publishVersionCheckResults.yml b/.github/workflows/publishVersionCheckResults.yml index 6679cf67cf4..be37b4d2230 100644 --- a/.github/workflows/publishVersionCheckResults.yml +++ b/.github/workflows/publishVersionCheckResults.yml @@ -17,19 +17,20 @@ on: # TODO: check if we can derive some inputs from the original workflow or the git-patch -permissions: {} +permissions: read-all +#permissions: {} jobs: versions-check-result: name: Publish Version Check Results runs-on: ubuntu-latest if: github.event.workflow_run.conclusion != 'skipped' - permissions: - checks: write - pull-requests: write - contents: read - issues: read - actions: read +# permissions: +# checks: write +# pull-requests: write +# contents: read +# issues: read +# actions: read steps: - name: Dump GitHub context @@ -41,11 +42,11 @@ jobs: with: script: | let allArtifacts = await github.rest.actions.listWorkflowRunArtifacts({ - owner: context.repo.owner, - repo: context.repo.repo, run_id: context.payload.workflow_run.id, + ...context.repo }); - return allArtifacts.data.artifacts.find(artifact => artifact.name == 'versions-git-patch') + let artifact = allArtifacts.data.artifacts.find(artifact => artifact.name == 'versions-git-patch') + return artifact?.id - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 if: steps.search-git-patch.outputs.result @@ -59,12 +60,11 @@ jobs: if: steps.search-git-patch.outputs.result with: script: | - let matchArtifact = ${{ steps.search-git-patch.outputs.result }} + let matchArtifactId = ${{ steps.search-git-patch.outputs.result }} let download = await github.rest.actions.downloadArtifact({ - owner: context.repo.owner, - repo: context.repo.repo, - artifact_id: matchArtifact.id, + artifact_id: matchArtifactId, archive_format: 'zip', + ...context.repo }); let fs = require('fs'); fs.writeFileSync(`${process.env.GITHUB_WORKSPACE}/patch.zip`, Buffer.from(download.data));