mirror of
https://github.com/penpot/penpot.git
synced 2026-07-20 21:17:44 +00:00
⏪ Backport github workflows from develop
This commit is contained in:
parent
e498dd2382
commit
b3105e6b82
76
.github/workflows/auto-label.yml
vendored
Normal file
76
.github/workflows/auto-label.yml
vendored
Normal file
@ -0,0 +1,76 @@
|
||||
name: Auto Label and Add to Project
|
||||
|
||||
on:
|
||||
issues:
|
||||
types: [opened]
|
||||
pull_request:
|
||||
types: [opened]
|
||||
|
||||
jobs:
|
||||
triage:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Generate GitHub App token
|
||||
id: triage-app-token
|
||||
uses: actions/create-github-app-token@v1
|
||||
with:
|
||||
app-id: ${{ secrets.TRIAGE_APP_ID }}
|
||||
private-key: ${{ secrets.TRIAGE_APP_PRIVATE_KEY }}
|
||||
owner: penpot
|
||||
|
||||
- name: Process Issue or PR
|
||||
uses: actions/github-script@v7
|
||||
with:
|
||||
github-token: ${{ steps.triage-app-token.outputs.token }}
|
||||
script: |
|
||||
// === 1. CONFIGURATION ===
|
||||
const PROJECT_NUMBER = 8; // <--- Replace with your project board number
|
||||
const IS_ORG = true; // <--- Set to false if this is a personal project, true if an organization
|
||||
const OWNER = context.repo.owner;
|
||||
const REPO = context.repo.repo;
|
||||
|
||||
const issueNumber = context.issue.number;
|
||||
const isPR = !!context.payload.pull_request;
|
||||
const contentId = isPR ? context.payload.pull_request.node_id : context.payload.issue.node_id;
|
||||
|
||||
// Define your labels here
|
||||
const labelToApply = 'needs triage';
|
||||
|
||||
// === 2. APPLY THE LABEL ===
|
||||
console.log(`Applying label "${labelToApply}" to ${isPR ? 'PR' : 'Issue'} #${issueNumber}...`);
|
||||
await github.rest.issues.addLabels({
|
||||
issue_number: issueNumber,
|
||||
owner: OWNER,
|
||||
repo: REPO,
|
||||
labels: [labelToApply]
|
||||
});
|
||||
|
||||
// === 3. ADD TO PROJECT BOARD ===
|
||||
console.log(`Fetching Project #${PROJECT_NUMBER} ID...`);
|
||||
const projectQuery = `
|
||||
query($owner: String!, $number: Int!) {
|
||||
${IS_ORG ? 'organization' : 'user'}(login: $owner) {
|
||||
projectV2(number: $number) {
|
||||
id
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
const projectRes = await github.graphql(projectQuery, { owner: OWNER, number: PROJECT_NUMBER });
|
||||
const projectId = IS_ORG ? projectRes.organization.projectV2.id : projectRes.user.projectV2.id;
|
||||
|
||||
console.log(`Adding item to project board...`);
|
||||
const addToProjectMutation = `
|
||||
mutation($projectId: ID!, $contentId: ID!) {
|
||||
addProjectV2ItemById(input: {projectId: $projectId, contentId: $contentId}) {
|
||||
item {
|
||||
id
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
await github.graphql(addToProjectMutation, { projectId, contentId });
|
||||
console.log("Automation successfully completed!");
|
||||
|
||||
4
.github/workflows/build-bundle.yml
vendored
4
.github/workflows/build-bundle.yml
vendored
@ -37,6 +37,10 @@ on:
|
||||
required: false
|
||||
default: 'yes'
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ inputs.gh_ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
build-bundle:
|
||||
name: Build and Upload Penpot Bundle
|
||||
|
||||
4
.github/workflows/build-docker.yml
vendored
4
.github/workflows/build-docker.yml
vendored
@ -16,6 +16,10 @@ on:
|
||||
required: true
|
||||
default: 'develop'
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ inputs.gh_ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
build-and-push:
|
||||
name: Build and Push Penpot Docker Images
|
||||
|
||||
2
.github/workflows/tests-mcp.yml
vendored
2
.github/workflows/tests-mcp.yml
vendored
@ -49,4 +49,4 @@ jobs:
|
||||
- name: Tests
|
||||
working-directory: ./mcp
|
||||
run: |
|
||||
pnpm -r run test;
|
||||
pnpm run test;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user