diff --git a/.github/workflows/project.yaml b/.github/workflows/project.yaml new file mode 100644 index 0000000..2dd9b03 --- /dev/null +++ b/.github/workflows/project.yaml @@ -0,0 +1,57 @@ +--- + +name: 'Project' +on: + workflow_run: + workflows: + - 'Triage' + types: + - completed + + +permissions: + contents: read + actions: read + + +jobs: + + prepare-project-triage: + name: Project Triage + runs-on: ubuntu-latest + outputs: + triage_event_name: ${{ steps.triage-output.outputs.triage_event_name }} + triage_event_action: ${{ steps.triage-output.outputs.triage_event_action }} + triage_item_number: ${{ steps.triage-output.outputs.triage_item_number }} + triage_item_url: ${{ steps.triage-output.outputs.triage_item_url }} + steps: + + ## Additional Steps + + - name: Fetch triage Details + uses: actions/download-artifact@v4 + with: + name: triage-details-project + run-id: ${{ github.event.workflow_run.id }} + + + - name: Set Outputs + id: triage-output + shell: bash + run: | + cat triage_details-project.txt > $GITHUB_OUTPUT + + + project: + name: Project + needs: + - prepare-project-triage + uses: nofusscomputing/action_project/.github/workflows/project.yaml@development + with: + PROJECT_URL: https://github.com/orgs/nofusscomputing/projects/3 + TRIAGE_EVENT_NAME: ${{ needs.prepare-project-triage.outputs.triage_event_name }} + TRIAGE_EVENT_ACTION: ${{ needs.prepare-project-triage.outputs.triage_event_action }} + TRIAGE_ITEM_NUMBER: ${{ needs.prepare-project-triage.outputs.triage_item_number }} + TRIAGE_ITEM_URL: ${{ needs.prepare-project-triage.outputs.triage_item_url }} + secrets: + WORKFLOW_TOKEN: ${{ secrets.WORKFLOW_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/triage.yaml b/.github/workflows/triage.yaml index 1896dee..b2f523e 100644 --- a/.github/workflows/triage.yaml +++ b/.github/workflows/triage.yaml @@ -27,11 +27,43 @@ on: jobs: + project: - name: Project - uses: nofusscomputing/action_project/.github/workflows/project.yaml@development - with: - PROJECT_URL: https://github.com/orgs/nofusscomputing/projects/3 - secrets: - WORKFLOW_TOKEN: ${{ secrets.WORKFLOW_TOKEN }} + name: Fetch Triage Details + runs-on: ubuntu-latest + steps: + + - name: Collect Triage Details + shell: bash + run: | + echo "triage_event_name=${{ github.event_name }}" > triage_details-project.txt; + echo "triage_event_action=${{ github.event.action }}" >> triage_details-project.txt; + + if [ "${{ github.event_name }}" == 'pull_request' ]; then + + echo "triage_item_number=${{ github.event.pull_request.number }}" >> triage_details-project.txt; + + echo "triage_item_url=https://github.com/${{ github.repository }}/pull/${{ github.event.pull_request.number }}" >> triage_details-project.txt; + + else + + echo "triage_item_number=${{ github.event.issue.number }}" >> triage_details-project.txt; + + echo "triage_item_url=https://github.com/${{ github.repository }}/issues/${{ github.event.issue.number }}" >> triage_details-project.txt; + + fi; + + + echo "[Debug]************************************"; + + cat triage_details-project.txt; + + echo "[Debug]************************************"; + + + - name: Upload Triage Data + uses: actions/upload-artifact@v4 + with: + name: triage-details-project + path: triage_details-project.txt