Skip to content

Commit

Permalink
Fix posting reproducibility index to PR
Browse files Browse the repository at this point in the history
  • Loading branch information
tiziano88 committed Apr 23, 2020
1 parent dd3cdbd commit c72f318
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/reproducibility.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,38 @@ jobs:
- name: Checkout branch
uses: actions/checkout@v2

# Also post a reply on the PR thread with the contents of the index, after merge.
# commit_sha: context.sha
- name: Post Reproducibility Index (post-merge only)
uses: actions/github-script@0.9.0
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
const opts = await github.repos.listPullRequestsAssociatedWithCommit({
owner: context.repo.owner,
repo: context.repo.repo,
commit_sha: 'dd3cdbdd433a14e1183475924f6f26e64859609f'
});
console.log('opts: ' + JSON.stringify(opts));
// See:
// - https://octokit.github.io/rest.js/v17#previews
// - https://developer.github.com/v3/repos/commits/#list-pull-requests-associated-with-commit
opts.mediaType = {
previews: ['groot']
};
console.log('opts: ' + JSON.stringify(opts));
const issues = await github.paginate(opts);
console.log('issues: ' + JSON.stringify(issues));
await github.issues.createComment({
issue_number: issues[0].number,
owner: context.repo.owner,
repo: context.repo.repo,
body: 'Test'
});
# Build Docker image, caching from the latest version from the remote repository.
- name: Docker build
timeout-minutes: 30
Expand Down Expand Up @@ -46,6 +78,12 @@ jobs:
const fs = require('fs').promises;
file_content = await fs.readFile('./reproducibility_index');
await github.repos.listPullRequestsAssociatedWithCommit({
owner: context.repo.owner,
repo: context.repo.repo,
commit_sha: '${GITHUB_SHA}'
});
await github.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
Expand Down

0 comments on commit c72f318

Please sign in to comment.