Skip to content

Task: Platform Service Gateway Image Pull secrets #301

Task: Platform Service Gateway Image Pull secrets

Task: Platform Service Gateway Image Pull secrets #301

name: Add new issues to Refinement Board with status "Validation"
on:
issues:
types: [opened]
env:
ACTIONS_STEP_DEBUG: true
jobs:
add_to_refinement_as_validation:
if: contains(fromJson('["backlog"]'), github.event.repository.name) # filter by repository name
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Authenticate with GitHub App
id: auth
uses: tibdex/github-app-token@v1
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.PRIVATE_KEY }}
installation_id: ${{ secrets.INSTALLATION_ID }}
- name: Add issue to Project "Refinement" and Set Status to "Validation"
uses: actions/github-script@v7
with:
github-token: ${{ steps.auth.outputs.token }}
script: |
// below are the IDs for the Project, Status Field, and "Validation" Status Option.
// Those IDs can all be retrieved using the GitHub Action "get-project-column-ids.yml" (in case they change of we introduce new ones)
const projectId = "PVT_kwDOClHx584AyckH"; // Project ID for "Refinement Board"
const statusFieldId = "PVTSSF_lADOClHx584AyckHzgoZZ94"; // "Status" Field ID of that Project
const statusOptionId = "f75ad846"; // Option ID for "Validation" Status
const issue = context.payload.issue;
const org = context.payload.repository.owner.login;
// Step 1: Add issue to Project
const itemResponse = await github.graphql(`
mutation($projectId: ID!, $contentId: ID!) {
addProjectV2ItemById(input: {projectId: $projectId, contentId: $contentId}) {
item {
id
}
}
}
`, {
projectId: projectId,
contentId: issue.node_id
});
const itemId = itemResponse.addProjectV2ItemById.item.id;
// Step 2: Set the Status field
await github.graphql(`
mutation($projectId: ID!, $itemId: ID!, $fieldId: ID!, $optionId: String!) {
updateProjectV2ItemFieldValue(input: {
projectId: $projectId,
itemId: $itemId,
fieldId: $fieldId,
value: { singleSelectOptionId: $optionId }
}) {
projectV2Item {
id
}
}
}
`, {
projectId: projectId,
itemId: itemId,
fieldId: statusFieldId,
optionId: statusOptionId
});
console.log(`Issue ${issue.title} added to Project "Refinement" and status set to Validation.`);