Skip to content
This repository has been archived by the owner on May 31, 2024. It is now read-only.

.github/workflows/project.yml #20

.github/workflows/project.yml

.github/workflows/project.yml #20

Workflow file for this run

name: Project
on:
issues:
types:
- opened
pull_request:
types:
- opened
jobs:
check-secret:
runs-on: ubuntu-latest
outputs:
pat: ${{ steps.pat-check.outputs.defined }}
steps:
- name: Check PAT
id: pat-check
shell: bash
run: |
if [ "${{ secrets.GH_PROJECT_PAT }}" != '' ]; then
echo "defined=true" >> $GITHUB_OUTPUT;
else
echo "defined=false" >> $GITHUB_OUTPUT;
fi
add-issue:
if: ${{ github.event_name == 'issues' && github.event.action == 'opened' && needs.check-secret.outputs.pat == 'true'}}
name: Add issue to project
runs-on: ubuntu-latest
needs: [check-secret]
steps:
- name: Add to project
uses: actions/[email protected]
with:
project-url: https://github.com/orgs/tiki/projects/1
github-token: ${{ secrets.GH_PROJECT_PAT }}
add-pr:
if: ${{ github.event_name == 'pull_request' && github.event.action == 'opened' && needs.check-secret.outputs.pat == 'true'}}
name: Add pull request to project
runs-on: ubuntu-latest
needs: [check-secret]
steps:
- name: Add to project
uses: actions/[email protected]
with:
project-url: https://github.com/orgs/tiki/projects/1
github-token: ${{ secrets.GH_PROJECT_PAT }}
id: add-project
- name: Add to sprint
uses: titoportas/[email protected]
with:
project-url: https://github.com/orgs/tiki/projects/1
github-token: ${{ secrets.GH_PROJECT_PAT }}
item-id: ${{ steps.add-project.outputs.itemId }}
field-keys: Status,Sprint
field-values: In Progress,[0]