Replace the usual CI with a comment based on the branch #63
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This runs jobs which pyiron modules should run on pushes or PRs to main | |
name: Push-Pull | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
jobs: | |
comment: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Post a comment | |
uses: actions/github-script@v7 | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
script: | | |
const issueNumber = context.payload.pull_request.number; | |
const branchName = context.payload.pull_request.head.ref; | |
const repoUrl = `https://github.com/${context.repo.owner}/${context.repo.repo}/blob/${branchName}`; | |
const comment = `Here is the [source code for this branch](${repoUrl})`; | |
await github.rest.issues.createComment({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
issue_number: issueNumber, | |
body: repoUrl, | |
}); |