From ae184565f10c8176a2d06d75cfb74ab18edad2ad Mon Sep 17 00:00:00 2001 From: Yann David Date: Thu, 28 Mar 2024 19:09:04 -0400 Subject: [PATCH] GHA, won. I can't comment from forks... (#120) * GHA, won. I can't comment from forks... * Rename action --- .../{pr.yml => check-version-bump.yml} | 29 +++++-------------- .github/workflows/comment.yml | 21 -------------- 2 files changed, 7 insertions(+), 43 deletions(-) rename .github/workflows/{pr.yml => check-version-bump.yml} (71%) delete mode 100644 .github/workflows/comment.yml diff --git a/.github/workflows/pr.yml b/.github/workflows/check-version-bump.yml similarity index 71% rename from .github/workflows/pr.yml rename to .github/workflows/check-version-bump.yml index df07193..fdf3990 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/check-version-bump.yml @@ -1,4 +1,4 @@ -name: Check PR +name: Check for version Bump on: pull_request: @@ -6,10 +6,8 @@ on: - main jobs: - check: + verify-version-bump: runs-on: ubuntu-latest - permissions: - contents: write steps: - name: Checkout repository uses: actions/checkout@v4 @@ -58,28 +56,15 @@ jobs: LAST_TAG="${{ steps.previoustag.outputs.tag }}" NEW_TAG="v${{ steps.get_version.outputs.version }}" RESULT=$(ci/assets/checksemver.sh ${NEW_TAG} ${LAST_TAG}) + echo "============================================" if [ "${RESULT}" == "1" ]; then - echo "Version bump found." > comment.txt + echo "Version bump found." exit 0 elif [ "${RESULT}" == "0" ]; then - echo "Version bump did not happen. ${LAST_TAG} is the same as ${NEW_TAG}" > comment.txt + echo "Version bump did not happen. ${LAST_TAG} is the same as ${NEW_TAG}" exit 1 else - echo "Version bump did not happen. ${LAST_TAG} is higher than ${NEW_TAG}" > comment.txt + echo "Version bump did not happen. ${LAST_TAG} is higher than ${NEW_TAG}" exit 1 fi - - name: Upload html diff ⬆️ - id: artifact-upload - uses: actions/upload-artifact@v4 - with: - name: CommentMsg - path: comment.txt - retention-days: 7 - - name: Dispatch information to repository 🗣️ - uses: peter-evans/repository-dispatch@v2 - with: - token: ${{ secrets.TOKENFORCOMMENT }} - repository: typositoire/concourse-helm3-resource - event-type: pr-comment - client-payload: '{"pr_number": "${{ github.event.number }}", "artifact_url": "${{ steps.artifact-upload.outputs.artifact-url }}", "run_id": "${{ github.run_id }}"}' - \ No newline at end of file + echo "============================================" \ No newline at end of file diff --git a/.github/workflows/comment.yml b/.github/workflows/comment.yml deleted file mode 100644 index c7d737a..0000000 --- a/.github/workflows/comment.yml +++ /dev/null @@ -1,21 +0,0 @@ -name: Comment on pull request - -on: - repository_dispatch: - types: [pr-comment] - -jobs: - comment: - runs-on: ubuntu-latest - steps: - - uses: actions/download-artifact@v4 - with: - name: CommentMsg - path: tmp/ - - name: Display structure of downloaded files - run: ls -R tmp/ - - name: PR comment with html diff 💬 - uses: thollander/actions-comment-pull-request@v2.5.0 - with: - pr_number: ${{ github.event.client_payload.pr_number }} - filePath: tmp/comment.txt \ No newline at end of file