Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create PR label workflow for CRIB #11544

Merged
merged 2 commits into from
Dec 18, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 54 additions & 0 deletions .github/workflows/pr-labels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: PR Labels

on:
pull_request:
types: [labeled]

jobs:
crib:
runs-on: ubuntu-latest
permissions:
issues: write
pull-requests: write
steps:
- name: Comment on PR
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
with:
script: |
const labelsToCheck = ["crib"];
const { owner, repo, number: prNumber } = context.issue;
const { data: labels } = await github.rest.issues.listLabelsOnIssue({ owner, repo, issue_number: prNumber });
const labelMatches = labels.some(label => labelsToCheck.includes(label.name));

if (!labelMatches) {
core.info("No 'crib' PR label found. Proceeding.");
return;
}

const comment = `## CRIB Environment Details :information_source:

CRIB activated via the 'crib' label. To destroy the environment, remove the 'crib' PR label or close the PR.

Please review the following details:

### Subdomains

_Use these subdomains to access the CRIB environment. They are prefixes to the internal base domain._

- crib-chain-${prNumber}-node1.
- crib-chain-${prNumber}-node2.
- crib-chain-${prNumber}-node3.
- crib-chain-${prNumber}-node4.
- crib-chain-${prNumber}-node5.
- crib-chain-${prNumber}-node6.
- crib-chain-${prNumber}-geth-http.
- crib-chain-${prNumber}-geth-ws.
- crib-chain-${prNumber}-mockserver.
`;

await github.rest.issues.createComment({
owner,
repo,
issue_number: prNumber,
body: comment
});
Loading