diff --git a/.github/workflows/move-closed-issues.yaml b/.github/workflows/move-closed-issues.yaml index 134552068c..4c332f62d3 100644 --- a/.github/workflows/move-closed-issues.yaml +++ b/.github/workflows/move-closed-issues.yaml @@ -3,8 +3,9 @@ on: issues: types: - closed + jobs: - move-closed-issue: + Move-Closed-Issues: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -17,8 +18,9 @@ jobs: const sortIssues = script({context}) return sortIssues result-encoding: string - - uses: alex-page/github-project-automation-plus@v0.9.0 - with: - project: Project Board - column: ${{ steps.sort-closed-issues.outputs.result }} - repo-token: ${{ secrets.HACKFORLA_BOT_PA_TOKEN }} + + # Post-migration to Projects Beta: + # Move-Closed-Issues to "QA" column by default; OR move to "Done" based on `sort-closed-issues.js` + - name: Move Closed Issues + run: echo "Based on its labels, issue should be sorted to 'status' of '${{ steps.sort-closed-issues.outputs.result }}'" + diff --git a/github-actions/move-closed-issues/sort-closed-issues.js b/github-actions/move-closed-issues/sort-closed-issues.js index ec24771489..109ced4628 100644 --- a/github-actions/move-closed-issues/sort-closed-issues.js +++ b/github-actions/move-closed-issues/sort-closed-issues.js @@ -1,13 +1,15 @@ const obtainLabels = require('../utils/obtain-labels') /** - * Check the labels of an issue, and return the column the issue should be sorted into when closed + * Check the labels of an issue, and return the 'status' the issue should be sorted into when closed * @param {Object} context - context object from actions/github-script - * @returns - returns the appropriate column, which is passed on to the next action + * @returns - returns the appropriate 'status', which is passed on to the next action */ function main({ context }) { - const doneColumn = "Done" - const QAColumn = "QA" + + // Using Projects Beta 'status' + const doneStatus = "Done" + const QAStatus = "QA" const hardLabels = [ "Feature: Refactor CSS", @@ -32,23 +34,27 @@ function main({ context }) { // checks if label is an override label const isOverrideLabel = label => overrideSoftLabels.includes(label); - /** If issue includes hard labels there should be no visual changes - move to the Done column */ + /** If issue includes hard labels there should be no visual changes - move to the Done status */ if (issueLabels.some(isHardLabel)) { - return doneColumn; + console.log("Found hard label- sort to 'Done' status."); + return doneStatus; } - /** if issue does not include a hard label, but does contain an override label - move to QA */ + /** if issue does not include a hard label, but does contain an override label - move to QA status */ if (issueLabels.some(isOverrideLabel)) { - return QAColumn; + console.log("Found override label- sort to 'QA' status."); + return QAStatus; } - /** if issue includes soft labels (no hard or override) - move to Done */ + /** if issue includes soft labels (no hard or override) - move to Done status */ if (issueLabels.some(isSoftLabel)) { - return doneColumn; + console.log("Found soft label- sort to 'Done' status."); + return doneStatus; } - // all other issues go to QA column - return QAColumn; + // all other issues go to QA status + console.log("Didn't find hard or soft label- sort to 'QA' status."); + return QAStatus; } module.exports = main;