From 94ccb56f7d8902cd918789f79e3b95d1bb253086 Mon Sep 17 00:00:00 2001 From: "tomoya.kimura" Date: Mon, 4 Sep 2023 14:27:02 +0900 Subject: [PATCH 1/2] chore: update sync upstream script Signed-off-by: tomoya.kimura --- .github/workflows/sync-upstream.yaml | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/.github/workflows/sync-upstream.yaml b/.github/workflows/sync-upstream.yaml index 267fe2135a627..56a0ed660844d 100644 --- a/.github/workflows/sync-upstream.yaml +++ b/.github/workflows/sync-upstream.yaml @@ -1,9 +1,12 @@ name: sync-upstream on: - schedule: - - cron: 0 1 * * 1-5 workflow_dispatch: + inputs: + target_branch: + description: Target branch + required: true + type: string jobs: sync-upstream: @@ -28,12 +31,17 @@ jobs: script: | const holiday_jp = require(`${process.env.GITHUB_WORKSPACE}/node_modules/@holiday-jp/holiday_jp`) core.setOutput('holiday', holiday_jp.isHoliday(new Date())); + - name: Print warning for invalid branch name + if: ${{ inputs.target_branch == 'tier4/main' }} + run: | + echo This action cannot be performed on 'tier4/main' branch + - name: Run sync-branches + if: ${{ inputs.target_branch != 'tier4/main' }} uses: autowarefoundation/autoware-github-actions/sync-branches@v1 - if: ${{ steps.is-holiday.outputs.holiday != 'true' || github.event_name == 'workflow_dispatch' }} with: token: ${{ steps.generate-token.outputs.token }} - base-branch: tier4/main + base-branch: ${{ inputs.target_branch }} sync-pr-branch: sync-upstream sync-target-repository: https://github.com/autowarefoundation/autoware.universe.git sync-target-branch: main From 16b5acfb5c12ffcce9eba727c9eb4099aa6639b6 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 4 Sep 2023 05:32:32 +0000 Subject: [PATCH 2/2] style(pre-commit): autofix --- .github/workflows/sync-upstream.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/sync-upstream.yaml b/.github/workflows/sync-upstream.yaml index 56a0ed660844d..90420ec404042 100644 --- a/.github/workflows/sync-upstream.yaml +++ b/.github/workflows/sync-upstream.yaml @@ -34,7 +34,7 @@ jobs: - name: Print warning for invalid branch name if: ${{ inputs.target_branch == 'tier4/main' }} run: | - echo This action cannot be performed on 'tier4/main' branch + echo This action cannot be performed on 'tier4/main' branch - name: Run sync-branches if: ${{ inputs.target_branch != 'tier4/main' }}