From d7f2053a5eac2f52ad7f5b26509b6872ceda71a4 Mon Sep 17 00:00:00 2001 From: Adrienne Stilp Date: Fri, 24 May 2024 16:02:44 -0700 Subject: [PATCH 01/28] Try using relative paths for actions I think this will run all actions from the same reference of the repo? --- check-requirements-files/action.yml | 2 +- run-pip-compile/action.yml | 2 +- update-requirements-files/action.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/check-requirements-files/action.yml b/check-requirements-files/action.yml index e4197c1..074effe 100644 --- a/check-requirements-files/action.yml +++ b/check-requirements-files/action.yml @@ -26,7 +26,7 @@ runs: - name: Run pip-compile id: run-pip-compile - uses: UW-GAC/pip-tools-actions/run-pip-compile@main + uses: ./run-pip-compile with: requirements_files: ${{ inputs.requirements_files }} pip-tools-version: ${{ inputs.pip-tools-version }} diff --git a/run-pip-compile/action.yml b/run-pip-compile/action.yml index a02a271..54bcc3a 100644 --- a/run-pip-compile/action.yml +++ b/run-pip-compile/action.yml @@ -29,7 +29,7 @@ runs: steps: - name: Set up pip-tools - uses: UW-GAC/pip-tools-actions/setup-pip-tools@main + uses: ./setup-pip-tools with: pip-tools-version: ${{ inputs.pip-tools-version }} diff --git a/update-requirements-files/action.yml b/update-requirements-files/action.yml index 65eb338..e11e085 100644 --- a/update-requirements-files/action.yml +++ b/update-requirements-files/action.yml @@ -48,7 +48,7 @@ runs: - name: Run pip-compile id: run-pip-compile - uses: UW-GAC/pip-tools-actions/run-pip-compile@main + uses: ./run-pip-compile with: requirements_files: ${{ inputs.requirements_files }} pip-tools-version: ${{ inputs.pip-tools-version }} From 4e64cb555e1f957c3b19a9053c7b21c586ee4672 Mon Sep 17 00:00:00 2001 From: Adrienne Stilp Date: Fri, 24 May 2024 16:18:56 -0700 Subject: [PATCH 02/28] Symlink action repo so we can call actions using same ref --- check-requirements-files/action.yml | 8 +++++++- run-pip-compile/action.yml | 8 +++++++- update-requirements-files/action.yml | 8 +++++++- 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/check-requirements-files/action.yml b/check-requirements-files/action.yml index 074effe..74c1133 100644 --- a/check-requirements-files/action.yml +++ b/check-requirements-files/action.yml @@ -24,9 +24,15 @@ runs: using: "composite" steps: + - name: Symlink current action repo + env: + action_path: ${{ github.action_path }} + run: ln -fs ${{ env.action_path }}/.. .github/.action_repo + shell: bash + - name: Run pip-compile id: run-pip-compile - uses: ./run-pip-compile + uses: ./.github/.action_repo/run-pip-compile with: requirements_files: ${{ inputs.requirements_files }} pip-tools-version: ${{ inputs.pip-tools-version }} diff --git a/run-pip-compile/action.yml b/run-pip-compile/action.yml index 54bcc3a..f173261 100644 --- a/run-pip-compile/action.yml +++ b/run-pip-compile/action.yml @@ -28,8 +28,14 @@ runs: using: "composite" steps: + - name: Symlink current action repo + env: + action_path: ${{ github.action_path }} + run: ln -fs ${{ env.action_path }}/.. .github/.action_repo + shell: bash + - name: Set up pip-tools - uses: ./setup-pip-tools + uses: ./.github/.action_repo/setup-pip-tools with: pip-tools-version: ${{ inputs.pip-tools-version }} diff --git a/update-requirements-files/action.yml b/update-requirements-files/action.yml index e11e085..23172b7 100644 --- a/update-requirements-files/action.yml +++ b/update-requirements-files/action.yml @@ -46,9 +46,15 @@ runs: using: "composite" steps: + - name: Symlink current action repo + env: + action_path: ${{ github.action_path }} + run: ln -fs ${{ env.action_path }}/.. .github/.action_repo + shell: bash + - name: Run pip-compile id: run-pip-compile - uses: ./run-pip-compile + uses: ./.github/.action_repo/run-pip-compile with: requirements_files: ${{ inputs.requirements_files }} pip-tools-version: ${{ inputs.pip-tools-version }} From e64f8ba8afb01af748b6a4fcdcb96152048f68db Mon Sep 17 00:00:00 2001 From: Adrienne Stilp Date: Fri, 24 May 2024 16:24:06 -0700 Subject: [PATCH 03/28] Only symlink if the path does not exist yet --- check-requirements-files/action.yml | 4 ++-- run-pip-compile/action.yml | 4 ++-- update-requirements-files/action.yml | 4 +++- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/check-requirements-files/action.yml b/check-requirements-files/action.yml index 74c1133..8cc20ef 100644 --- a/check-requirements-files/action.yml +++ b/check-requirements-files/action.yml @@ -27,8 +27,8 @@ runs: - name: Symlink current action repo env: action_path: ${{ github.action_path }} - run: ln -fs ${{ env.action_path }}/.. .github/.action_repo - shell: bash + run: | + if [[! -d .github/.action_repo ]]; then ln -fs ${{ env.action_path }}/.. .github/.action_repo; fi - name: Run pip-compile id: run-pip-compile diff --git a/run-pip-compile/action.yml b/run-pip-compile/action.yml index f173261..96a8c4a 100644 --- a/run-pip-compile/action.yml +++ b/run-pip-compile/action.yml @@ -31,8 +31,8 @@ runs: - name: Symlink current action repo env: action_path: ${{ github.action_path }} - run: ln -fs ${{ env.action_path }}/.. .github/.action_repo - shell: bash + run: | + if [[! -d .github/.action_repo ]]; then ln -fs ${{ env.action_path }}/.. .github/.action_repo; fi - name: Set up pip-tools uses: ./.github/.action_repo/setup-pip-tools diff --git a/update-requirements-files/action.yml b/update-requirements-files/action.yml index 23172b7..ed60a34 100644 --- a/update-requirements-files/action.yml +++ b/update-requirements-files/action.yml @@ -49,7 +49,9 @@ runs: - name: Symlink current action repo env: action_path: ${{ github.action_path }} - run: ln -fs ${{ env.action_path }}/.. .github/.action_repo + run: | + if [[! -d .github/.action_repo ]]; then ln -fs ${{ env.action_path }}/.. .github/.action_repo; fi + shell: bash - name: Run pip-compile From 4940eee4ef41dd558a7e3eddbab74b7fee46892b Mon Sep 17 00:00:00 2001 From: Adrienne Stilp Date: Fri, 24 May 2024 16:25:38 -0700 Subject: [PATCH 04/28] Add shell to symlink step --- check-requirements-files/action.yml | 1 + run-pip-compile/action.yml | 1 + update-requirements-files/action.yml | 1 - 3 files changed, 2 insertions(+), 1 deletion(-) diff --git a/check-requirements-files/action.yml b/check-requirements-files/action.yml index 8cc20ef..4ccdd9e 100644 --- a/check-requirements-files/action.yml +++ b/check-requirements-files/action.yml @@ -29,6 +29,7 @@ runs: action_path: ${{ github.action_path }} run: | if [[! -d .github/.action_repo ]]; then ln -fs ${{ env.action_path }}/.. .github/.action_repo; fi + shell: bash - name: Run pip-compile id: run-pip-compile diff --git a/run-pip-compile/action.yml b/run-pip-compile/action.yml index 96a8c4a..467b02f 100644 --- a/run-pip-compile/action.yml +++ b/run-pip-compile/action.yml @@ -33,6 +33,7 @@ runs: action_path: ${{ github.action_path }} run: | if [[! -d .github/.action_repo ]]; then ln -fs ${{ env.action_path }}/.. .github/.action_repo; fi + shell: bash - name: Set up pip-tools uses: ./.github/.action_repo/setup-pip-tools diff --git a/update-requirements-files/action.yml b/update-requirements-files/action.yml index ed60a34..71fce8b 100644 --- a/update-requirements-files/action.yml +++ b/update-requirements-files/action.yml @@ -51,7 +51,6 @@ runs: action_path: ${{ github.action_path }} run: | if [[! -d .github/.action_repo ]]; then ln -fs ${{ env.action_path }}/.. .github/.action_repo; fi - shell: bash - name: Run pip-compile From 79847b56a490fc5143d2203845b02f743a278893 Mon Sep 17 00:00:00 2001 From: Adrienne Stilp Date: Fri, 24 May 2024 16:29:50 -0700 Subject: [PATCH 05/28] Try adding a debugging "tree" step --- check-requirements-files/action.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/check-requirements-files/action.yml b/check-requirements-files/action.yml index 4ccdd9e..966b464 100644 --- a/check-requirements-files/action.yml +++ b/check-requirements-files/action.yml @@ -31,6 +31,11 @@ runs: if [[! -d .github/.action_repo ]]; then ln -fs ${{ env.action_path }}/.. .github/.action_repo; fi shell: bash + - name: List symlink contents + run: | + tree + shell: bash + - name: Run pip-compile id: run-pip-compile uses: ./.github/.action_repo/run-pip-compile From 4ea0e2ad3fe1f07a8bb5ff2465cff2d3d24769bf Mon Sep 17 00:00:00 2001 From: Adrienne Stilp Date: Fri, 24 May 2024 16:30:51 -0700 Subject: [PATCH 06/28] Print the tree of the symlinked action_repo specifically --- check-requirements-files/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/check-requirements-files/action.yml b/check-requirements-files/action.yml index 966b464..ae04db8 100644 --- a/check-requirements-files/action.yml +++ b/check-requirements-files/action.yml @@ -33,7 +33,7 @@ runs: - name: List symlink contents run: | - tree + tree .github/.action_repo shell: bash - name: Run pip-compile From 429b4df4527421ac1bb2a738a62dfefadba645aa Mon Sep 17 00:00:00 2001 From: Adrienne Stilp Date: Fri, 24 May 2024 16:37:59 -0700 Subject: [PATCH 07/28] Fix spacing of bash command with [[ and ! --- check-requirements-files/action.yml | 2 +- run-pip-compile/action.yml | 2 +- update-requirements-files/action.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/check-requirements-files/action.yml b/check-requirements-files/action.yml index ae04db8..c8d8a89 100644 --- a/check-requirements-files/action.yml +++ b/check-requirements-files/action.yml @@ -28,7 +28,7 @@ runs: env: action_path: ${{ github.action_path }} run: | - if [[! -d .github/.action_repo ]]; then ln -fs ${{ env.action_path }}/.. .github/.action_repo; fi + if [[ ! -d .github/.action_repo ]]; then ln -fs ${{ env.action_path }}/.. .github/.action_repo; fi shell: bash - name: List symlink contents diff --git a/run-pip-compile/action.yml b/run-pip-compile/action.yml index 467b02f..25e14ee 100644 --- a/run-pip-compile/action.yml +++ b/run-pip-compile/action.yml @@ -32,7 +32,7 @@ runs: env: action_path: ${{ github.action_path }} run: | - if [[! -d .github/.action_repo ]]; then ln -fs ${{ env.action_path }}/.. .github/.action_repo; fi + if [[ ! -d .github/.action_repo ]]; then ln -fs ${{ env.action_path }}/.. .github/.action_repo; fi shell: bash - name: Set up pip-tools diff --git a/update-requirements-files/action.yml b/update-requirements-files/action.yml index 71fce8b..74acb04 100644 --- a/update-requirements-files/action.yml +++ b/update-requirements-files/action.yml @@ -50,7 +50,7 @@ runs: env: action_path: ${{ github.action_path }} run: | - if [[! -d .github/.action_repo ]]; then ln -fs ${{ env.action_path }}/.. .github/.action_repo; fi + if [[ ! -d .github/.action_repo ]]; then ln -fs ${{ env.action_path }}/.. .github/.action_repo; fi shell: bash - name: Run pip-compile From d35d8ebdce9412980b75fb3cdcd8a960a5058989 Mon Sep 17 00:00:00 2001 From: Adrienne Stilp Date: Tue, 28 May 2024 09:39:28 -0700 Subject: [PATCH 08/28] Try symlinking actions into the directory one level up Adding the symlink in the .github directory makes the call that checks repository status always return a "CHANGED" status, even if no requirements files were changed. Symlink the action repo outside of the main CI directory. --- check-requirements-files/action.yml | 6 +++--- run-pip-compile/action.yml | 4 ++-- update-requirements-files/action.yml | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/check-requirements-files/action.yml b/check-requirements-files/action.yml index c8d8a89..fdbcbec 100644 --- a/check-requirements-files/action.yml +++ b/check-requirements-files/action.yml @@ -28,17 +28,17 @@ runs: env: action_path: ${{ github.action_path }} run: | - if [[ ! -d .github/.action_repo ]]; then ln -fs ${{ env.action_path }}/.. .github/.action_repo; fi + if [[ ! -d ../.action_repo ]]; then ln -fs ${{ env.action_path }}/.. ../.action_repo; fi shell: bash - name: List symlink contents run: | - tree .github/.action_repo + tree ../.action_repo shell: bash - name: Run pip-compile id: run-pip-compile - uses: ./.github/.action_repo/run-pip-compile + uses: ../.action_repo/run-pip-compile with: requirements_files: ${{ inputs.requirements_files }} pip-tools-version: ${{ inputs.pip-tools-version }} diff --git a/run-pip-compile/action.yml b/run-pip-compile/action.yml index 25e14ee..02367d0 100644 --- a/run-pip-compile/action.yml +++ b/run-pip-compile/action.yml @@ -32,11 +32,11 @@ runs: env: action_path: ${{ github.action_path }} run: | - if [[ ! -d .github/.action_repo ]]; then ln -fs ${{ env.action_path }}/.. .github/.action_repo; fi + if [[ ! -d ../.action_repo ]]; then ln -fs ${{ env.action_path }}/.. ../.action_repo; fi shell: bash - name: Set up pip-tools - uses: ./.github/.action_repo/setup-pip-tools + uses: ../.action_repo/setup-pip-tools with: pip-tools-version: ${{ inputs.pip-tools-version }} diff --git a/update-requirements-files/action.yml b/update-requirements-files/action.yml index 74acb04..2d3474d 100644 --- a/update-requirements-files/action.yml +++ b/update-requirements-files/action.yml @@ -50,12 +50,12 @@ runs: env: action_path: ${{ github.action_path }} run: | - if [[ ! -d .github/.action_repo ]]; then ln -fs ${{ env.action_path }}/.. .github/.action_repo; fi + if [[ ! -d ../.action_repo ]]; then ln -fs ${{ env.action_path }}/.. ../.action_repo; fi shell: bash - name: Run pip-compile id: run-pip-compile - uses: ./.github/.action_repo/run-pip-compile + uses: ../.action_repo/run-pip-compile with: requirements_files: ${{ inputs.requirements_files }} pip-tools-version: ${{ inputs.pip-tools-version }} From 47d86900ffcfc746f31e842de222586392fd11af Mon Sep 17 00:00:00 2001 From: Adrienne Stilp Date: Tue, 28 May 2024 09:53:47 -0700 Subject: [PATCH 09/28] Try a new way of symlinking actions See https://github.com/orgs/community/discussions/41927#discussioncomment-4605881 --- check-requirements-files/action.yml | 9 ++------- run-pip-compile/action.yml | 4 ++-- update-requirements-files/action.yml | 4 ++-- 3 files changed, 6 insertions(+), 11 deletions(-) diff --git a/check-requirements-files/action.yml b/check-requirements-files/action.yml index fdbcbec..d4e8531 100644 --- a/check-requirements-files/action.yml +++ b/check-requirements-files/action.yml @@ -28,17 +28,12 @@ runs: env: action_path: ${{ github.action_path }} run: | - if [[ ! -d ../.action_repo ]]; then ln -fs ${{ env.action_path }}/.. ../.action_repo; fi - shell: bash - - - name: List symlink contents - run: | - tree ../.action_repo + if [[! -d /home/runner/work/_actions/current ]]; then ln -fs $(realpath ../) /home/runner/work/_actions/current; fi shell: bash - name: Run pip-compile id: run-pip-compile - uses: ../.action_repo/run-pip-compile + uses: ./../../_actions/current/run-pip-compile with: requirements_files: ${{ inputs.requirements_files }} pip-tools-version: ${{ inputs.pip-tools-version }} diff --git a/run-pip-compile/action.yml b/run-pip-compile/action.yml index 02367d0..6e56d10 100644 --- a/run-pip-compile/action.yml +++ b/run-pip-compile/action.yml @@ -32,11 +32,11 @@ runs: env: action_path: ${{ github.action_path }} run: | - if [[ ! -d ../.action_repo ]]; then ln -fs ${{ env.action_path }}/.. ../.action_repo; fi + if [[! -d /home/runner/work/_actions/current ]]; then ln -fs $(realpath ../) /home/runner/work/_actions/current; fi shell: bash - name: Set up pip-tools - uses: ../.action_repo/setup-pip-tools + uses: ./../../_actions/current/setup-pip-tools with: pip-tools-version: ${{ inputs.pip-tools-version }} diff --git a/update-requirements-files/action.yml b/update-requirements-files/action.yml index 2d3474d..5d4837e 100644 --- a/update-requirements-files/action.yml +++ b/update-requirements-files/action.yml @@ -50,12 +50,12 @@ runs: env: action_path: ${{ github.action_path }} run: | - if [[ ! -d ../.action_repo ]]; then ln -fs ${{ env.action_path }}/.. ../.action_repo; fi + if [[! -d /home/runner/work/_actions/current ]]; then ln -fs $(realpath ../) /home/runner/work/_actions/current; fi shell: bash - name: Run pip-compile id: run-pip-compile - uses: ../.action_repo/run-pip-compile + uses: ./../../_actions/current/run-pip-compile with: requirements_files: ${{ inputs.requirements_files }} pip-tools-version: ${{ inputs.pip-tools-version }} From 4737ecb0d01b95703aef911c538091b9ca6fa553 Mon Sep 17 00:00:00 2001 From: Adrienne Stilp Date: Tue, 28 May 2024 09:55:13 -0700 Subject: [PATCH 10/28] Fix [[ ! issue again --- check-requirements-files/action.yml | 2 +- run-pip-compile/action.yml | 2 +- update-requirements-files/action.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/check-requirements-files/action.yml b/check-requirements-files/action.yml index d4e8531..f945ef6 100644 --- a/check-requirements-files/action.yml +++ b/check-requirements-files/action.yml @@ -28,7 +28,7 @@ runs: env: action_path: ${{ github.action_path }} run: | - if [[! -d /home/runner/work/_actions/current ]]; then ln -fs $(realpath ../) /home/runner/work/_actions/current; fi + if [[ ! -d /home/runner/work/_actions/current ]]; then ln -fs $(realpath ../) /home/runner/work/_actions/current; fi shell: bash - name: Run pip-compile diff --git a/run-pip-compile/action.yml b/run-pip-compile/action.yml index 6e56d10..e626bbf 100644 --- a/run-pip-compile/action.yml +++ b/run-pip-compile/action.yml @@ -32,7 +32,7 @@ runs: env: action_path: ${{ github.action_path }} run: | - if [[! -d /home/runner/work/_actions/current ]]; then ln -fs $(realpath ../) /home/runner/work/_actions/current; fi + if [[ ! -d /home/runner/work/_actions/current ]]; then ln -fs $(realpath ../) /home/runner/work/_actions/current; fi shell: bash - name: Set up pip-tools diff --git a/update-requirements-files/action.yml b/update-requirements-files/action.yml index 5d4837e..d621e10 100644 --- a/update-requirements-files/action.yml +++ b/update-requirements-files/action.yml @@ -50,7 +50,7 @@ runs: env: action_path: ${{ github.action_path }} run: | - if [[! -d /home/runner/work/_actions/current ]]; then ln -fs $(realpath ../) /home/runner/work/_actions/current; fi + if [[ ! -d /home/runner/work/_actions/current ]]; then ln -fs $(realpath ../) /home/runner/work/_actions/current; fi shell: bash - name: Run pip-compile From 8f378908cb4c48c427f79aaa3ea53c9370bf40e7 Mon Sep 17 00:00:00 2001 From: Adrienne Stilp Date: Tue, 28 May 2024 10:08:23 -0700 Subject: [PATCH 11/28] Revert "Fix [[ ! issue again" This reverts commit 4737ecb0d01b95703aef911c538091b9ca6fa553. --- check-requirements-files/action.yml | 2 +- run-pip-compile/action.yml | 2 +- update-requirements-files/action.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/check-requirements-files/action.yml b/check-requirements-files/action.yml index f945ef6..d4e8531 100644 --- a/check-requirements-files/action.yml +++ b/check-requirements-files/action.yml @@ -28,7 +28,7 @@ runs: env: action_path: ${{ github.action_path }} run: | - if [[ ! -d /home/runner/work/_actions/current ]]; then ln -fs $(realpath ../) /home/runner/work/_actions/current; fi + if [[! -d /home/runner/work/_actions/current ]]; then ln -fs $(realpath ../) /home/runner/work/_actions/current; fi shell: bash - name: Run pip-compile diff --git a/run-pip-compile/action.yml b/run-pip-compile/action.yml index e626bbf..6e56d10 100644 --- a/run-pip-compile/action.yml +++ b/run-pip-compile/action.yml @@ -32,7 +32,7 @@ runs: env: action_path: ${{ github.action_path }} run: | - if [[ ! -d /home/runner/work/_actions/current ]]; then ln -fs $(realpath ../) /home/runner/work/_actions/current; fi + if [[! -d /home/runner/work/_actions/current ]]; then ln -fs $(realpath ../) /home/runner/work/_actions/current; fi shell: bash - name: Set up pip-tools diff --git a/update-requirements-files/action.yml b/update-requirements-files/action.yml index d621e10..5d4837e 100644 --- a/update-requirements-files/action.yml +++ b/update-requirements-files/action.yml @@ -50,7 +50,7 @@ runs: env: action_path: ${{ github.action_path }} run: | - if [[ ! -d /home/runner/work/_actions/current ]]; then ln -fs $(realpath ../) /home/runner/work/_actions/current; fi + if [[! -d /home/runner/work/_actions/current ]]; then ln -fs $(realpath ../) /home/runner/work/_actions/current; fi shell: bash - name: Run pip-compile From 448ee69f742c4cafa5e0d1dfa05a77c62b402beb Mon Sep 17 00:00:00 2001 From: Adrienne Stilp Date: Tue, 28 May 2024 10:08:23 -0700 Subject: [PATCH 12/28] Revert "Try a new way of symlinking actions" This reverts commit 47d86900ffcfc746f31e842de222586392fd11af. --- check-requirements-files/action.yml | 9 +++++++-- run-pip-compile/action.yml | 4 ++-- update-requirements-files/action.yml | 4 ++-- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/check-requirements-files/action.yml b/check-requirements-files/action.yml index d4e8531..fdbcbec 100644 --- a/check-requirements-files/action.yml +++ b/check-requirements-files/action.yml @@ -28,12 +28,17 @@ runs: env: action_path: ${{ github.action_path }} run: | - if [[! -d /home/runner/work/_actions/current ]]; then ln -fs $(realpath ../) /home/runner/work/_actions/current; fi + if [[ ! -d ../.action_repo ]]; then ln -fs ${{ env.action_path }}/.. ../.action_repo; fi + shell: bash + + - name: List symlink contents + run: | + tree ../.action_repo shell: bash - name: Run pip-compile id: run-pip-compile - uses: ./../../_actions/current/run-pip-compile + uses: ../.action_repo/run-pip-compile with: requirements_files: ${{ inputs.requirements_files }} pip-tools-version: ${{ inputs.pip-tools-version }} diff --git a/run-pip-compile/action.yml b/run-pip-compile/action.yml index 6e56d10..02367d0 100644 --- a/run-pip-compile/action.yml +++ b/run-pip-compile/action.yml @@ -32,11 +32,11 @@ runs: env: action_path: ${{ github.action_path }} run: | - if [[! -d /home/runner/work/_actions/current ]]; then ln -fs $(realpath ../) /home/runner/work/_actions/current; fi + if [[ ! -d ../.action_repo ]]; then ln -fs ${{ env.action_path }}/.. ../.action_repo; fi shell: bash - name: Set up pip-tools - uses: ./../../_actions/current/setup-pip-tools + uses: ../.action_repo/setup-pip-tools with: pip-tools-version: ${{ inputs.pip-tools-version }} diff --git a/update-requirements-files/action.yml b/update-requirements-files/action.yml index 5d4837e..2d3474d 100644 --- a/update-requirements-files/action.yml +++ b/update-requirements-files/action.yml @@ -50,12 +50,12 @@ runs: env: action_path: ${{ github.action_path }} run: | - if [[! -d /home/runner/work/_actions/current ]]; then ln -fs $(realpath ../) /home/runner/work/_actions/current; fi + if [[ ! -d ../.action_repo ]]; then ln -fs ${{ env.action_path }}/.. ../.action_repo; fi shell: bash - name: Run pip-compile id: run-pip-compile - uses: ./../../_actions/current/run-pip-compile + uses: ../.action_repo/run-pip-compile with: requirements_files: ${{ inputs.requirements_files }} pip-tools-version: ${{ inputs.pip-tools-version }} From 78671ee2f3926b9f6e5627c2509c10c87e3b5156 Mon Sep 17 00:00:00 2001 From: Adrienne Stilp Date: Tue, 28 May 2024 10:08:23 -0700 Subject: [PATCH 13/28] Revert "Try symlinking actions into the directory one level up" This reverts commit d35d8ebdce9412980b75fb3cdcd8a960a5058989. --- check-requirements-files/action.yml | 6 +++--- run-pip-compile/action.yml | 4 ++-- update-requirements-files/action.yml | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/check-requirements-files/action.yml b/check-requirements-files/action.yml index fdbcbec..c8d8a89 100644 --- a/check-requirements-files/action.yml +++ b/check-requirements-files/action.yml @@ -28,17 +28,17 @@ runs: env: action_path: ${{ github.action_path }} run: | - if [[ ! -d ../.action_repo ]]; then ln -fs ${{ env.action_path }}/.. ../.action_repo; fi + if [[ ! -d .github/.action_repo ]]; then ln -fs ${{ env.action_path }}/.. .github/.action_repo; fi shell: bash - name: List symlink contents run: | - tree ../.action_repo + tree .github/.action_repo shell: bash - name: Run pip-compile id: run-pip-compile - uses: ../.action_repo/run-pip-compile + uses: ./.github/.action_repo/run-pip-compile with: requirements_files: ${{ inputs.requirements_files }} pip-tools-version: ${{ inputs.pip-tools-version }} diff --git a/run-pip-compile/action.yml b/run-pip-compile/action.yml index 02367d0..25e14ee 100644 --- a/run-pip-compile/action.yml +++ b/run-pip-compile/action.yml @@ -32,11 +32,11 @@ runs: env: action_path: ${{ github.action_path }} run: | - if [[ ! -d ../.action_repo ]]; then ln -fs ${{ env.action_path }}/.. ../.action_repo; fi + if [[ ! -d .github/.action_repo ]]; then ln -fs ${{ env.action_path }}/.. .github/.action_repo; fi shell: bash - name: Set up pip-tools - uses: ../.action_repo/setup-pip-tools + uses: ./.github/.action_repo/setup-pip-tools with: pip-tools-version: ${{ inputs.pip-tools-version }} diff --git a/update-requirements-files/action.yml b/update-requirements-files/action.yml index 2d3474d..74acb04 100644 --- a/update-requirements-files/action.yml +++ b/update-requirements-files/action.yml @@ -50,12 +50,12 @@ runs: env: action_path: ${{ github.action_path }} run: | - if [[ ! -d ../.action_repo ]]; then ln -fs ${{ env.action_path }}/.. ../.action_repo; fi + if [[ ! -d .github/.action_repo ]]; then ln -fs ${{ env.action_path }}/.. .github/.action_repo; fi shell: bash - name: Run pip-compile id: run-pip-compile - uses: ../.action_repo/run-pip-compile + uses: ./.github/.action_repo/run-pip-compile with: requirements_files: ${{ inputs.requirements_files }} pip-tools-version: ${{ inputs.pip-tools-version }} From 12f43661de642e7a64bf223e4d4188590e48c2b4 Mon Sep 17 00:00:00 2001 From: Adrienne Stilp Date: Tue, 28 May 2024 10:14:52 -0700 Subject: [PATCH 14/28] Try printing out the env variables for debugging --- check-requirements-files/action.yml | 5 +++++ run-pip-compile/action.yml | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/check-requirements-files/action.yml b/check-requirements-files/action.yml index c8d8a89..0e8f5a0 100644 --- a/check-requirements-files/action.yml +++ b/check-requirements-files/action.yml @@ -24,6 +24,11 @@ runs: using: "composite" steps: + - name: Print out current environment + run: | + env + shell: bash + - name: Symlink current action repo env: action_path: ${{ github.action_path }} diff --git a/run-pip-compile/action.yml b/run-pip-compile/action.yml index 25e14ee..e9b1cba 100644 --- a/run-pip-compile/action.yml +++ b/run-pip-compile/action.yml @@ -28,6 +28,11 @@ runs: using: "composite" steps: + - name: Print out current environment + run: | + env + shell: bash + - name: Symlink current action repo env: action_path: ${{ github.action_path }} From 7a03588afeb07f043b7b2d3afd3e8900fab2aca5 Mon Sep 17 00:00:00 2001 From: Adrienne Stilp Date: Tue, 28 May 2024 10:45:46 -0700 Subject: [PATCH 15/28] Try working with only the output .txt files with git commands Instead of checking whether anything in the repo has changed, only check if the output requiremetns files have changed. Similarly, only add the output requirements files in the pull request. --- check-requirements-files/action.yml | 2 +- run-pip-compile/action.yml | 23 ++++++++++++++++++----- update-requirements-files/action.yml | 5 +++-- 3 files changed, 22 insertions(+), 8 deletions(-) diff --git a/check-requirements-files/action.yml b/check-requirements-files/action.yml index 0e8f5a0..e0daf70 100644 --- a/check-requirements-files/action.yml +++ b/check-requirements-files/action.yml @@ -50,7 +50,7 @@ runs: pip-compile-args: ${{ inputs.pip_compile_args }} - name: "Fail if there are changes to requirements files" - if: steps.run-pip-compile.outputs.FILES_CHANGED == '1' + if: steps.run-pip-compile.outputs.CHANGES_DETECTED == '1' run: | echo "Changes to requirements files detected" exit 1 diff --git a/run-pip-compile/action.yml b/run-pip-compile/action.yml index e9b1cba..28729a1 100644 --- a/run-pip-compile/action.yml +++ b/run-pip-compile/action.yml @@ -22,7 +22,7 @@ inputs: outputs: files_changed: description: "A flag indicating whether the requirements files have changed." - value: ${{ steps.pip-compile-changes.outputs.FILES_CHANGED }} + value: ${{ steps.pip-compile-changes.outputs.CHANGES_DETECTED }} runs: using: "composite" @@ -60,11 +60,24 @@ runs: INPUT_REQUIREMENTS_FILES: ${{ inputs.requirements_files }} INPUTS_PIP_COMPILE_ARGS: ${{ inputs.pip_compile_args }} + - Get names of output files from pip-compile + id: get-output-files + run: | + output_files=() + for file in $INPUT_REQUIREMENTS_FILES + do + output_files+=("${file%.in}.txt") + done + echo "OUTPUT_FILES=${new_files[@]}" >> $GITHUB_OUTPUT + shell: bash + env: + INPUT_REQUIREMENTS_FILES: ${{ inputs.requirements_files }} + - name: Set output id: pip-compile-changes run: | function check() { - if [[ -z "$(git status --porcelain $STATUS_ARGS $PATHSPEC)" ]]; + if [[ -z "$(git status --porcelain ${{ steps.pip-compile-changes.outputs.OUTPUT_FILES}} $STATUS_ARGS $PATHSPEC)" ]]; then echo "0" else @@ -72,12 +85,12 @@ runs: fi } - echo "FILES_CHANGED=$(check)" >> $GITHUB_OUTPUT + echo "CHANGES_DETECTED=$(check)" >> $GITHUB_OUTPUT shell: bash - name: List changes - if: steps.pip-compile-changes.outputs.FILES_CHANGED + if: steps.pip-compile-changes.outputs.CHANGES_DETECTED run: | - git status + git status ${{ steps.pip-compile-changes.outputs.OUTPUT_FILES}} git diff shell: bash diff --git a/update-requirements-files/action.yml b/update-requirements-files/action.yml index 74acb04..fcc2ea5 100644 --- a/update-requirements-files/action.yml +++ b/update-requirements-files/action.yml @@ -62,7 +62,7 @@ runs: pip-compile-args: ${{ inputs.pip_compile_args }} - name: Create Pull Request - if: steps.run-pip-compile.outputs.FILES_CHANGED == '1' + if: steps.run-pip-compile.outputs.CHANGES_DETECTED == '1' id: create-pull-request uses: peter-evans/create-pull-request@v6 with: @@ -72,9 +72,10 @@ runs: labels: ${{ inputs.pr-labels }} # Create a new branch for each pull request. branch: pip-tools/update-requirements-files/${{ inputs.pr-branch-suffix }} + add-paths: ${{ steps.run-pip-compile.outputs.OUTPUT_FILES }} - name: "Fail if there are changes to requirements files" - if: steps.run-pip-compile.outputs.FILES_CHANGED == '1' + if: steps.run-pip-compile.outputs.CHANGES_DETECTED == '1' run: | echo "Changes to requirements files detected" echo "Please merge pull request to resolve:" From a6b808d1b64354d2a52756f2b691bd57cc85711b Mon Sep 17 00:00:00 2001 From: Adrienne Stilp Date: Tue, 28 May 2024 10:47:19 -0700 Subject: [PATCH 16/28] Remove env printing steps --- check-requirements-files/action.yml | 5 ----- run-pip-compile/action.yml | 5 ----- 2 files changed, 10 deletions(-) diff --git a/check-requirements-files/action.yml b/check-requirements-files/action.yml index e0daf70..12315d9 100644 --- a/check-requirements-files/action.yml +++ b/check-requirements-files/action.yml @@ -24,11 +24,6 @@ runs: using: "composite" steps: - - name: Print out current environment - run: | - env - shell: bash - - name: Symlink current action repo env: action_path: ${{ github.action_path }} diff --git a/run-pip-compile/action.yml b/run-pip-compile/action.yml index 28729a1..e34fc75 100644 --- a/run-pip-compile/action.yml +++ b/run-pip-compile/action.yml @@ -28,11 +28,6 @@ runs: using: "composite" steps: - - name: Print out current environment - run: | - env - shell: bash - - name: Symlink current action repo env: action_path: ${{ github.action_path }} From 55c0c48313fd13e472766771196da37405edd092 Mon Sep 17 00:00:00 2001 From: Adrienne Stilp Date: Tue, 28 May 2024 10:48:40 -0700 Subject: [PATCH 17/28] Add forgotten -name to step --- run-pip-compile/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/run-pip-compile/action.yml b/run-pip-compile/action.yml index e34fc75..0d35aec 100644 --- a/run-pip-compile/action.yml +++ b/run-pip-compile/action.yml @@ -55,7 +55,7 @@ runs: INPUT_REQUIREMENTS_FILES: ${{ inputs.requirements_files }} INPUTS_PIP_COMPILE_ARGS: ${{ inputs.pip_compile_args }} - - Get names of output files from pip-compile + - name: Get names of output files from pip-compile id: get-output-files run: | output_files=() From f1c51a6b5c9eddd1c01c57b79440dc0319827dab Mon Sep 17 00:00:00 2001 From: Adrienne Stilp Date: Tue, 28 May 2024 10:56:08 -0700 Subject: [PATCH 18/28] Use correct variable name when setting output files --- run-pip-compile/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/run-pip-compile/action.yml b/run-pip-compile/action.yml index 0d35aec..fec2f26 100644 --- a/run-pip-compile/action.yml +++ b/run-pip-compile/action.yml @@ -63,7 +63,7 @@ runs: do output_files+=("${file%.in}.txt") done - echo "OUTPUT_FILES=${new_files[@]}" >> $GITHUB_OUTPUT + echo "OUTPUT_FILES=${output_files[@]}" >> $GITHUB_OUTPUT shell: bash env: INPUT_REQUIREMENTS_FILES: ${{ inputs.requirements_files }} From 78314fe90633f08f1eeaf78113a1b154c6343fcb Mon Sep 17 00:00:00 2001 From: Adrienne Stilp Date: Tue, 28 May 2024 10:59:50 -0700 Subject: [PATCH 19/28] Add debugging print statement --- check-requirements-files/action.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/check-requirements-files/action.yml b/check-requirements-files/action.yml index 12315d9..c66c409 100644 --- a/check-requirements-files/action.yml +++ b/check-requirements-files/action.yml @@ -44,6 +44,12 @@ runs: pip-tools-version: ${{ inputs.pip-tools-version }} pip-compile-args: ${{ inputs.pip_compile_args }} + - name: "debugging" + run: | + echo "CHANGES_DETECTED: ${{ steps.run-pip-compile.outputs.CHANGES_DETECTED }}" + echo "FILES_CHANGED: ${{ steps.run-pip-compile.outputs.FILES_CHANGED }}" + shell: bash + - name: "Fail if there are changes to requirements files" if: steps.run-pip-compile.outputs.CHANGES_DETECTED == '1' run: | From e287c89daaad470f9f10ecc15e687433ebcce54f Mon Sep 17 00:00:00 2001 From: Adrienne Stilp Date: Tue, 28 May 2024 11:05:02 -0700 Subject: [PATCH 20/28] Fix step ids when accessing output --- run-pip-compile/action.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/run-pip-compile/action.yml b/run-pip-compile/action.yml index fec2f26..687c145 100644 --- a/run-pip-compile/action.yml +++ b/run-pip-compile/action.yml @@ -72,7 +72,7 @@ runs: id: pip-compile-changes run: | function check() { - if [[ -z "$(git status --porcelain ${{ steps.pip-compile-changes.outputs.OUTPUT_FILES}} $STATUS_ARGS $PATHSPEC)" ]]; + if [[ -z "$(git status --porcelain ${{ steps.get-output-files.outputs.OUTPUT_FILES}})" ]]; then echo "0" else @@ -86,6 +86,6 @@ runs: - name: List changes if: steps.pip-compile-changes.outputs.CHANGES_DETECTED run: | - git status ${{ steps.pip-compile-changes.outputs.OUTPUT_FILES}} + git status ${{ steps.get-output-files.outputs.OUTPUT_FILES}} git diff shell: bash From e7856af458d0ec3b36324e1bf837463f425e268b Mon Sep 17 00:00:00 2001 From: Adrienne Stilp Date: Tue, 28 May 2024 11:05:18 -0700 Subject: [PATCH 21/28] Fix output printing in debugging step --- check-requirements-files/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/check-requirements-files/action.yml b/check-requirements-files/action.yml index c66c409..65987ca 100644 --- a/check-requirements-files/action.yml +++ b/check-requirements-files/action.yml @@ -47,7 +47,7 @@ runs: - name: "debugging" run: | echo "CHANGES_DETECTED: ${{ steps.run-pip-compile.outputs.CHANGES_DETECTED }}" - echo "FILES_CHANGED: ${{ steps.run-pip-compile.outputs.FILES_CHANGED }}" + echo "OUTPUT_FILES: ${{ steps.run-pip-compile.outputs.OUTPUT_FILES }}" shell: bash - name: "Fail if there are changes to requirements files" From 2d41090bb4008735e581b7ce200c81a63b7cecca Mon Sep 17 00:00:00 2001 From: Adrienne Stilp Date: Tue, 28 May 2024 11:09:25 -0700 Subject: [PATCH 22/28] Change step id for clarity --- run-pip-compile/action.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/run-pip-compile/action.yml b/run-pip-compile/action.yml index 687c145..9bb3fc3 100644 --- a/run-pip-compile/action.yml +++ b/run-pip-compile/action.yml @@ -69,7 +69,7 @@ runs: INPUT_REQUIREMENTS_FILES: ${{ inputs.requirements_files }} - name: Set output - id: pip-compile-changes + id: detect-changes run: | function check() { if [[ -z "$(git status --porcelain ${{ steps.get-output-files.outputs.OUTPUT_FILES}})" ]]; @@ -84,7 +84,7 @@ runs: shell: bash - name: List changes - if: steps.pip-compile-changes.outputs.CHANGES_DETECTED + if: steps.detect-changes.outputs.CHANGES_DETECTED run: | git status ${{ steps.get-output-files.outputs.OUTPUT_FILES}} git diff From ecf09c17a417eddc34ce7f31a160e1ec334c4783 Mon Sep 17 00:00:00 2001 From: Adrienne Stilp Date: Tue, 28 May 2024 11:15:24 -0700 Subject: [PATCH 23/28] Clean up various mistakes and typos Set the new FILES_CHANGED output in the header. Change the output variable names to match the ones used in the code for clarity. --- run-pip-compile/action.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/run-pip-compile/action.yml b/run-pip-compile/action.yml index 9bb3fc3..38c6ac9 100644 --- a/run-pip-compile/action.yml +++ b/run-pip-compile/action.yml @@ -20,9 +20,12 @@ inputs: required: false default: "" outputs: - files_changed: + CHANGES_DETECTED: description: "A flag indicating whether the requirements files have changed." - value: ${{ steps.pip-compile-changes.outputs.CHANGES_DETECTED }} + value: ${{ steps.detect-changes.outputs.CHANGES_DETECTED }} + OUTPUT_FILES: + description: "The names of the output files generated by pip-compile." + value: ${{ steps.get-output-files.outputs.OUTPUT_FILES }} runs: using: "composite" @@ -87,5 +90,5 @@ runs: if: steps.detect-changes.outputs.CHANGES_DETECTED run: | git status ${{ steps.get-output-files.outputs.OUTPUT_FILES}} - git diff + git diff ${{ steps.get-output-files.outputs.OUTPUT_FILES}} shell: bash From 1f6d07d5ed3bbdd3df94291ad9826e13479b9c8b Mon Sep 17 00:00:00 2001 From: Adrienne Stilp Date: Tue, 28 May 2024 11:28:36 -0700 Subject: [PATCH 24/28] Change output files to be a comma-separated list The create-pull-request action expects a comma-separated list of filenames. Try preparing that in a new step before creating the pull request. (Just passing the output without this prep didn't match any files, so no PR was created.) --- update-requirements-files/action.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/update-requirements-files/action.yml b/update-requirements-files/action.yml index fcc2ea5..6cc5997 100644 --- a/update-requirements-files/action.yml +++ b/update-requirements-files/action.yml @@ -61,6 +61,14 @@ runs: pip-tools-version: ${{ inputs.pip-tools-version }} pip-compile-args: ${{ inputs.pip_compile_args }} + - name: Prep output files for pull request + id: prep-output-files + run: | + # Replace spaces with commas + output_files_pr="${${{ steps.run-pip-compile.outputs.OUTPUT_FILES }}// /","}" + echo "OUTPUT_FILES_PR=${output_files_pr}" >> $GITHUB_OUTPUT + shell: bash + - name: Create Pull Request if: steps.run-pip-compile.outputs.CHANGES_DETECTED == '1' id: create-pull-request @@ -72,7 +80,7 @@ runs: labels: ${{ inputs.pr-labels }} # Create a new branch for each pull request. branch: pip-tools/update-requirements-files/${{ inputs.pr-branch-suffix }} - add-paths: ${{ steps.run-pip-compile.outputs.OUTPUT_FILES }} + add-paths: ${{ steps.prep-output-files.outputs.OUTPUT_FILES_PR }} - name: "Fail if there are changes to requirements files" if: steps.run-pip-compile.outputs.CHANGES_DETECTED == '1' From 134d41c3af54bd10b32364bf64d9d76667739a25 Mon Sep 17 00:00:00 2001 From: Adrienne Stilp Date: Tue, 28 May 2024 11:36:02 -0700 Subject: [PATCH 25/28] Add debugging statement to PR file prep step --- update-requirements-files/action.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/update-requirements-files/action.yml b/update-requirements-files/action.yml index 6cc5997..1ecf08d 100644 --- a/update-requirements-files/action.yml +++ b/update-requirements-files/action.yml @@ -66,6 +66,7 @@ runs: run: | # Replace spaces with commas output_files_pr="${${{ steps.run-pip-compile.outputs.OUTPUT_FILES }}// /","}" + echo $output_files_pr echo "OUTPUT_FILES_PR=${output_files_pr}" >> $GITHUB_OUTPUT shell: bash From 5a56d66e67a82f2d93487a54f438f051c8cf8cfa Mon Sep 17 00:00:00 2001 From: Adrienne Stilp Date: Tue, 28 May 2024 11:37:23 -0700 Subject: [PATCH 26/28] Add another debugging echo statement --- update-requirements-files/action.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/update-requirements-files/action.yml b/update-requirements-files/action.yml index 1ecf08d..2c6e905 100644 --- a/update-requirements-files/action.yml +++ b/update-requirements-files/action.yml @@ -65,6 +65,7 @@ runs: id: prep-output-files run: | # Replace spaces with commas + echo "${{ steps.run-pip-compile.outputs.OUTPUT_FILES }}" output_files_pr="${${{ steps.run-pip-compile.outputs.OUTPUT_FILES }}// /","}" echo $output_files_pr echo "OUTPUT_FILES_PR=${output_files_pr}" >> $GITHUB_OUTPUT From 58bd693666d000aee570a4839b45c7b2a0ca6578 Mon Sep 17 00:00:00 2001 From: Adrienne Stilp Date: Tue, 28 May 2024 11:38:59 -0700 Subject: [PATCH 27/28] Try fixing str replace step --- update-requirements-files/action.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/update-requirements-files/action.yml b/update-requirements-files/action.yml index 2c6e905..b428465 100644 --- a/update-requirements-files/action.yml +++ b/update-requirements-files/action.yml @@ -65,8 +65,8 @@ runs: id: prep-output-files run: | # Replace spaces with commas - echo "${{ steps.run-pip-compile.outputs.OUTPUT_FILES }}" - output_files_pr="${${{ steps.run-pip-compile.outputs.OUTPUT_FILES }}// /","}" + output_files="${{ steps.run-pip-compile.outputs.OUTPUT_FILES }}" + output_files_pr="${output_files// /","}" echo $output_files_pr echo "OUTPUT_FILES_PR=${output_files_pr}" >> $GITHUB_OUTPUT shell: bash From dccb80ec4ad81326d164eb19209d16cde519f420 Mon Sep 17 00:00:00 2001 From: Adrienne Stilp Date: Tue, 28 May 2024 15:14:13 -0700 Subject: [PATCH 28/28] Clean up files and remove debugging statements for merge --- check-requirements-files/action.yml | 11 ----------- run-pip-compile/action.yml | 2 +- update-requirements-files/action.yml | 2 +- 3 files changed, 2 insertions(+), 13 deletions(-) diff --git a/check-requirements-files/action.yml b/check-requirements-files/action.yml index 65987ca..7d86fb7 100644 --- a/check-requirements-files/action.yml +++ b/check-requirements-files/action.yml @@ -31,11 +31,6 @@ runs: if [[ ! -d .github/.action_repo ]]; then ln -fs ${{ env.action_path }}/.. .github/.action_repo; fi shell: bash - - name: List symlink contents - run: | - tree .github/.action_repo - shell: bash - - name: Run pip-compile id: run-pip-compile uses: ./.github/.action_repo/run-pip-compile @@ -44,12 +39,6 @@ runs: pip-tools-version: ${{ inputs.pip-tools-version }} pip-compile-args: ${{ inputs.pip_compile_args }} - - name: "debugging" - run: | - echo "CHANGES_DETECTED: ${{ steps.run-pip-compile.outputs.CHANGES_DETECTED }}" - echo "OUTPUT_FILES: ${{ steps.run-pip-compile.outputs.OUTPUT_FILES }}" - shell: bash - - name: "Fail if there are changes to requirements files" if: steps.run-pip-compile.outputs.CHANGES_DETECTED == '1' run: | diff --git a/run-pip-compile/action.yml b/run-pip-compile/action.yml index 38c6ac9..15ea1d4 100644 --- a/run-pip-compile/action.yml +++ b/run-pip-compile/action.yml @@ -71,7 +71,7 @@ runs: env: INPUT_REQUIREMENTS_FILES: ${{ inputs.requirements_files }} - - name: Set output + - name: Detect if any changes were made to requirements files id: detect-changes run: | function check() { diff --git a/update-requirements-files/action.yml b/update-requirements-files/action.yml index b428465..e7b7518 100644 --- a/update-requirements-files/action.yml +++ b/update-requirements-files/action.yml @@ -84,7 +84,7 @@ runs: branch: pip-tools/update-requirements-files/${{ inputs.pr-branch-suffix }} add-paths: ${{ steps.prep-output-files.outputs.OUTPUT_FILES_PR }} - - name: "Fail if there are changes to requirements files" + - name: Fail if there are changes to requirements files if: steps.run-pip-compile.outputs.CHANGES_DETECTED == '1' run: | echo "Changes to requirements files detected"