diff --git a/.github/workflows/shasum-summary.yml b/.github/workflows/shasum-summary.yml new file mode 100644 index 00000000000..8960362a7e7 --- /dev/null +++ b/.github/workflows/shasum-summary.yml @@ -0,0 +1,38 @@ +name: comment a SHASUM summary for each changed release + +on: + pull_request: + branches: [ "main" ] + +jobs: + comment-summary: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: ${{ github.event.pull_request.commits }} + - name: show changed files + run: git diff --no-commit-id --name-only ${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }} + - name: run shasum-summary + run: python3 contrib/shasum-summary/main.py ${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }} > comment + - name: show comment + run: cat comment + - uses: actions/github-script@v7 + with: + script: | + const fs = require('node:fs'); + fs.readFile('comment', 'utf8', (err, comment) => { + if (err) { + console.error(err); + return; + } + if (comment.length > 0) { + github.rest.issues.createComment({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: "${{ github.event.pull_request.head.sha }}\n\n" + comment + }); + } + }); diff --git a/contrib/touched-files-check/src/main.rs b/contrib/touched-files-check/src/main.rs index 5acc8d1fff9..971f6b0dc9d 100644 --- a/contrib/touched-files-check/src/main.rs +++ b/contrib/touched-files-check/src/main.rs @@ -57,7 +57,7 @@ fn check(touched_files: &str) -> Result<(Vec<&str>, HashSet<&str>), String> { (l.next().unwrap(), l.next().unwrap()) }; println!("Touched file: {status} {file}"); - if ["README.md", ".cirrus.yml", "contrib/"] + if ["README.md", ".cirrus.yml", "contrib/", ".github/"] .iter() .any(|ignore| file.starts_with(ignore)) {