Skip to content

Commit

Permalink
Print reproducibility index diff
Browse files Browse the repository at this point in the history
This should make it easier to actually understand what targets were
affected by a PR.

Ref. #861
  • Loading branch information
tiziano88 committed May 26, 2020
1 parent 3463024 commit 84cf14d
Showing 1 changed file with 19 additions and 4 deletions.
23 changes: 19 additions & 4 deletions .github/workflows/reproducibility.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,16 @@ jobs:
cd ./out
git add .
git status
git diff --staged
git diff --staged | tee ../reproducibility_index.diff
# Print out the index to the logs of the action.
- name: Print Reproducibility Index
run: cat ./reproducibility_index

# Print out the index diff (compared to the previous commit) to the logs of the action.
- name: Print Reproducibility Index diff
run: cat ./reproducibility_index.diff

# From the "out" folder, commit the results and push to the `hashes` branch.
# This step only applies to `push` events (not `pull_request`), even if there are no actual
# changes to commit in the "out" folder (in which case the commit will be empty, but it will
Expand All @@ -94,7 +98,8 @@ jobs:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
const fs = require('fs').promises;
const file_content = await fs.readFile('./reproducibility_index');
const reproducibility_index_content = await fs.readFile('./reproducibility_index');
const reproducibility_index_diff_content = await fs.readFile('./reproducibility_index.diff');
const opts = await github.repos.listPullRequestsAssociatedWithCommit({
owner: context.repo.owner,
Expand All @@ -114,5 +119,15 @@ jobs:
issue_number: issues[0].number,
owner: context.repo.owner,
repo: context.repo.repo,
body: 'Reproducibility index:\n\n```\n' + file_content + '\n```\n'
});
body: `Reproducibility Index:
\`\`\`
${reproducibility_index_content}
\`\`\`
Reproducibility Index diff:
\`\`\`diff
${reproducibility_index_diff_content}
\`\`\`
`});

0 comments on commit 84cf14d

Please sign in to comment.