From 1c84fe9a1cd2c208ca493e3195d74e00903edf2a Mon Sep 17 00:00:00 2001 From: RuteSantos <1160663@isep.ipp.pt> Date: Wed, 5 Jul 2023 21:42:41 +0100 Subject: [PATCH 1/4] feat: add if condition that validates an environment variable --- .github/workflows/fork-clone-build-deploy.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/fork-clone-build-deploy.yaml b/.github/workflows/fork-clone-build-deploy.yaml index 285c735..4cb64ff 100644 --- a/.github/workflows/fork-clone-build-deploy.yaml +++ b/.github/workflows/fork-clone-build-deploy.yaml @@ -78,7 +78,7 @@ jobs: console.log(`Repository ${response.data.full_name} was found.`); } catch (error) { console.error('Failed to get repository', error); - return error; + throw error; } } @@ -240,6 +240,7 @@ jobs: publish_branch: gh-pages - name: Create issue in the forked repository + if: ${{ env.FF_STEP_CREATE_ISSUE }} uses: actions/github-script@v4 with: github-token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} From 60fc6310af31f71e2550d58499071cf4fcbce18f Mon Sep 17 00:00:00 2001 From: RuteSantos <1160663@isep.ipp.pt> Date: Wed, 5 Jul 2023 21:51:50 +0100 Subject: [PATCH 2/4] bug: boolean environment variable is treated as string --- .github/workflows/fork-clone-build-deploy.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/fork-clone-build-deploy.yaml b/.github/workflows/fork-clone-build-deploy.yaml index 4cb64ff..5b4f8b0 100644 --- a/.github/workflows/fork-clone-build-deploy.yaml +++ b/.github/workflows/fork-clone-build-deploy.yaml @@ -240,7 +240,7 @@ jobs: publish_branch: gh-pages - name: Create issue in the forked repository - if: ${{ env.FF_STEP_CREATE_ISSUE }} + if: ${{ env.FF_STEP_CREATE_ISSUE == 'true' }} uses: actions/github-script@v4 with: github-token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} From 0591deee705d798dcde9597e8110cf0fe471e95b Mon Sep 17 00:00:00 2001 From: RuteSantos <1160663@isep.ipp.pt> Date: Wed, 5 Jul 2023 21:58:03 +0100 Subject: [PATCH 3/4] bug: wrongly using env instead of vars --- .github/workflows/fork-clone-build-deploy.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/fork-clone-build-deploy.yaml b/.github/workflows/fork-clone-build-deploy.yaml index 5b4f8b0..3c75088 100644 --- a/.github/workflows/fork-clone-build-deploy.yaml +++ b/.github/workflows/fork-clone-build-deploy.yaml @@ -240,7 +240,7 @@ jobs: publish_branch: gh-pages - name: Create issue in the forked repository - if: ${{ env.FF_STEP_CREATE_ISSUE == 'true' }} + if: ${{ vars.FF_STEP_CREATE_ISSUE == 'true' }} uses: actions/github-script@v4 with: github-token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} From 8d507f3fe6a4fde9eb966e18782c581c9f9c9fd5 Mon Sep 17 00:00:00 2001 From: RuteSantos <1160663@isep.ipp.pt> Date: Wed, 5 Jul 2023 22:15:35 +0100 Subject: [PATCH 4/4] docs(README): add section Feature Flags with the description of the variable FF_STEP_CREATE_ISSUE --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index 21d9d69..f561c3a 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,14 @@ Workflows to get your Flutter project as a web app with GitHub Pages. ![Workflow steps](./docs/action-steps.drawio.svg) +## Feature Flags + +The following flags are used to enable/disable features in the workflow + +| Flag Name | Flag Description | +| :--: | :-- | +| `FF_STEP_CREATE_ISSUE` | Repository variable used to enable/disable the step '_Create issue in the forked repository_' | + ## GitHub Action Workflow Inputs The following inputs must be passed to the workflow