From 1e2b80fe00e251ddae5ec0a56c95ebef8152bed1 Mon Sep 17 00:00:00 2001 From: Natsuki Ikeguchi Date: Sat, 27 May 2023 17:30:55 +0900 Subject: [PATCH 1/3] build: Run as a composite action --- action.yml | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/action.yml b/action.yml index 6332279..2b942ea 100644 --- a/action.yml +++ b/action.yml @@ -30,5 +30,22 @@ inputs: description: 'An OAuth token to access to the repository as a bot.' default: ${{ github.token }} runs: - using: 'docker' - image: 'docker://ghcr.io/siketyan/loxcan@sha256:6d9b332528755dfbf664606a94bdb7106a65cff620ed2c0bee51fcf134f87160' + using: 'composite' + steps: + - shell: bash + run: | + composer global require --dev siketyan/loxcan:^0.7.2 + + if [ "${{ inputs.report_enabled }}" = "true" ]; then + export LOXCAN_REPORTER_GITHUB="1" + export LOXCAN_REPORTER_GITHUB_OWNER="${{ inputs.owner }}}" + export LOXCAN_REPORTER_GITHUB_REPO="${{ inputs.repo }}" + export LOXCAN_REPORTER_GITHUB_ISSUE_NUMBER="${{ inputs.issue_number }}" + export LOXCAN_REPORTER_GITHUB_TOKEN="${{ inputs.token }}" + export LOXCAN_REPORTER_GITHUB_USERNAME="github-actions[bot]" + fi + + BRANCH_BASE="origin/${{ inputs.base }}" + BRANCH_HEAD="${{ github.sha }}" + + ~/.composer/vendor/bin/loxcan "${BRANCH_BASE}" "${BRANCH_HEAD}" From 3da827cc13dabbb9afcc1ac0c056a08e0f0df1cd Mon Sep 17 00:00:00 2001 From: Natsuki Ikeguchi Date: Sat, 27 May 2023 17:32:21 +0900 Subject: [PATCH 2/3] fix: Fix typo --- action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action.yml b/action.yml index 2b942ea..2e8f439 100644 --- a/action.yml +++ b/action.yml @@ -38,7 +38,7 @@ runs: if [ "${{ inputs.report_enabled }}" = "true" ]; then export LOXCAN_REPORTER_GITHUB="1" - export LOXCAN_REPORTER_GITHUB_OWNER="${{ inputs.owner }}}" + export LOXCAN_REPORTER_GITHUB_OWNER="${{ inputs.owner }}" export LOXCAN_REPORTER_GITHUB_REPO="${{ inputs.repo }}" export LOXCAN_REPORTER_GITHUB_ISSUE_NUMBER="${{ inputs.issue_number }}" export LOXCAN_REPORTER_GITHUB_TOKEN="${{ inputs.token }}" From 9a9803c36f8bae2364d8432bb84cc680814422e2 Mon Sep 17 00:00:00 2001 From: Natsuki Ikeguchi Date: Sat, 27 May 2023 17:35:50 +0900 Subject: [PATCH 3/3] build: Use github.action_path --- action.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/action.yml b/action.yml index 2e8f439..923ec82 100644 --- a/action.yml +++ b/action.yml @@ -34,7 +34,7 @@ runs: steps: - shell: bash run: | - composer global require --dev siketyan/loxcan:^0.7.2 + pushd '${{ github.action_path }}' && composer i -n && popd if [ "${{ inputs.report_enabled }}" = "true" ]; then export LOXCAN_REPORTER_GITHUB="1" @@ -48,4 +48,4 @@ runs: BRANCH_BASE="origin/${{ inputs.base }}" BRANCH_HEAD="${{ github.sha }}" - ~/.composer/vendor/bin/loxcan "${BRANCH_BASE}" "${BRANCH_HEAD}" + ${{ github.action_path }}/bin/loxcan "${BRANCH_BASE}" "${BRANCH_HEAD}"