Skip to content

Replace the usual CI with a comment based on the branch #63

Replace the usual CI with a comment based on the branch

Replace the usual CI with a comment based on the branch #63

Workflow file for this run

# 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,
});