Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: upgrade "Compare checksums" action #2917

Merged
merged 1 commit into from
Oct 30, 2023
Merged

feat: upgrade "Compare checksums" action #2917

merged 1 commit into from
Oct 30, 2023

Conversation

devchenyan
Copy link
Collaborator

@devchenyan devchenyan commented Oct 30, 2023

Issue:
Magickbase/neuron-public-issues#295

Test Job:

https://github.com/devchenyan/neuron/actions/runs/6687543940

Test check_checksums.yml:

name: Check Checksums

on:
  push:
  release:
    types: [published, prereleased]

jobs:
  compare:
    name: Compare checksums
    runs-on: macos-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v3

      - name: Generate checksums from artifacts
        run: ruby ./scripts/release-checksums.rb v0.111.0 | tee generated_checksums.txt

      - name: Fetch checksums from release note
        run: |
          curl "https://api.github.com/repos/nervosnetwork/neuron/releases/tags/v0.111.0" |\
          python3 -c "import sys, json; print(\"\n\".join(json.load(sys.stdin)['body'].splitlines()[-11:]))" |\
          tee release_note_checksums.txt

      - name: Compare
        run: diff generated_checksums.txt release_note_checksums.txt

      - id: comment_body
        run: |
          body=$(cat generated_checksums.txt)
          body="${body//'%'/'%25'}"
          body="${body//$'\n'/'%0A'}"
          body="${body//$'\r'/'%0D'}"
          echo "body=$body" >> $GITHUB_OUTPUT

      - uses: peter-evans/commit-comment@v2
        with:
          body: ${{ steps.comment_body.outputs.body }}

@Keith-CY Keith-CY merged commit f31c405 into develop Oct 30, 2023
24 checks passed
@Keith-CY Keith-CY deleted the feat-checksums branch October 30, 2023 05:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants