Skip to content

Commit a99554a

Browse files
Merge pull request #1 from protocolbuffers/subaction-version
Reuse the action ref specified by the caller for nested actions
2 parents 6c26806 + b64c264 commit a99554a

7 files changed

Lines changed: 60 additions & 18 deletions

File tree

bash/action.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,18 @@ inputs:
2626
runs:
2727
using: 'composite'
2828
steps:
29+
- name: Symlink current Actions repo
30+
env:
31+
GH_ACTION_DIR: ${{ github.workspace }}/../../_actions/${{ github.action_repository }}/${{ github.action_ref }}/
32+
GH_ACTION_CLONE: ${{ github.workspace }}/../../_actions/current
33+
shell: bash
34+
run: ln -fs $GH_ACTION_DIR $GH_ACTION_CLONE
35+
2936
- name: Setup Runner
30-
uses: protocolbuffers/protobuf-ci/internal/setup-runner@v1
37+
uses: ./../../_actions/current/internal/setup-runner
3138

3239
- name: Update stale files using Bazel
33-
uses: protocolbuffers/protobuf-ci/bazel@v1
40+
uses: ./../../_actions/current/bazel
3441
with:
3542
credentials: ${{ inputs.credentials }}
3643
bazel-cache: regenerate-stale-files

bazel-docker/action.yml

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,18 +43,25 @@ inputs:
4343
runs:
4444
using: 'composite'
4545
steps:
46+
- name: Symlink current Actions repo
47+
env:
48+
GH_ACTION_DIR: ${{ github.workspace }}/../../_actions/${{ github.action_repository }}/${{ github.action_ref }}/
49+
GH_ACTION_CLONE: ${{ github.workspace }}/../../_actions/current
50+
shell: bash
51+
run: ln -fs $GH_ACTION_DIR $GH_ACTION_CLONE
52+
4653
- name: Authenticate
4754
id: auth
48-
uses: protocolbuffers/protobuf-ci/internal/gcloud-auth@v1
55+
uses: ./../../_actions/current/internal/gcloud-auth
4956
with:
5057
credentials: ${{ inputs.credentials }}
5158

5259
- name: Setup Runner
53-
uses: protocolbuffers/protobuf-ci/internal/setup-runner@v1
60+
uses: ./../../_actions/current/internal/setup-runner
5461

5562
- name: Setup Bazel
5663
id: bazel
57-
uses: protocolbuffers/protobuf-ci/internal/bazel-setup@v1
64+
uses: ./../../_actions/current/internal/bazel-setup
5865
with:
5966
credentials-file: /workspace/$(basename ${{ steps.auth.outputs.credentials-file }})
6067
bazel-cache: ${{ inputs.bazel-cache }}
@@ -69,15 +76,15 @@ runs:
6976
run: echo "Invalid specification of both non-Bazel and Bazel command"; exit 1
7077

7178
- name: Run Bash Docker
72-
uses: protocolbuffers/protobuf-ci/internal/docker-run@v1
79+
uses: ./../../_actions/current/internal/docker-run
7380
if: ${{ inputs.bash }}
7481
with:
7582
image: ${{ inputs.image }}
7683
run-flags: --entrypoint "/bin/bash"
7784
command: -l -c "${{ inputs.bash }}"
7885

7986
- name: Run Bazel Docker
80-
uses: protocolbuffers/protobuf-ci/internal/docker-run@v1
87+
uses: ./../../_actions/current/internal/docker-run
8188
if: ${{ !inputs.bash }}
8289
with:
8390
image: ${{ inputs.image }}
@@ -86,4 +93,4 @@ runs:
8693
- name: Save Bazel repository cache
8794
# Only allow repository cache updates during post-submits.
8895
if: ${{ github.event_name != 'pull_request' && github.event_name != 'pull_request_target' }}
89-
uses: protocolbuffers/protobuf-ci/internal/repository-cache-save@v1
96+
uses: ./../../_actions/current/internal/repository-cache-save

bazel/action.yml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,18 +45,25 @@ inputs:
4545
runs:
4646
using: 'composite'
4747
steps:
48+
- name: Symlink current Actions repo
49+
env:
50+
GH_ACTION_DIR: ${{ github.workspace }}/../../_actions/${{ github.action_repository }}/${{ github.action_ref }}/
51+
GH_ACTION_CLONE: ${{ github.workspace }}/../../_actions/current
52+
shell: bash
53+
run: ln -fs $GH_ACTION_DIR $GH_ACTION_CLONE
54+
4855
- name: Authenticate
4956
id: auth
50-
uses: protocolbuffers/protobuf-ci/internal/gcloud-auth@v1
57+
uses: ./../../_actions/current/internal/gcloud-auth
5158
with:
5259
credentials: ${{ inputs.credentials }}
5360

5461
- name: Setup Runner
55-
uses: protocolbuffers/protobuf-ci/internal/setup-runner@v1
62+
uses: ./../../_actions/current/internal/setup-runner
5663

5764
- name: Setup Bazel
5865
id: bazel
59-
uses: protocolbuffers/protobuf-ci/internal/bazel-setup@v1
66+
uses: ./../../_actions/current/internal/bazel-setup
6067
with:
6168
credentials-file: ${{ steps.auth.outputs.credentials-file }}
6269
bazel-cache: ${{ inputs.bazel-cache }}
@@ -145,4 +152,4 @@ runs:
145152
- name: Save Bazel repository cache
146153
# Only allow repository cache updates during post-submits.
147154
if: ${{ github.event_name != 'pull_request' && github.event_name != 'pull_request_target'}}
148-
uses: protocolbuffers/protobuf-ci/internal/repository-cache-save@v1
155+
uses: ./../../_actions/current/internal/repository-cache-save

ccache/action.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,13 @@ inputs:
2626
runs:
2727
using: 'composite'
2828
steps:
29+
- name: Symlink current Actions repo
30+
env:
31+
GH_ACTION_DIR: ${{ github.workspace }}/../../_actions/${{ github.action_repository }}/${{ github.action_ref }}/
32+
GH_ACTION_CLONE: ${{ github.workspace }}/../../_actions/current
33+
shell: bash
34+
run: ln -fs $GH_ACTION_DIR $GH_ACTION_CLONE
35+
2936
- name: Configure ccache environment variables
3037
shell: bash
3138
run: |
@@ -40,7 +47,7 @@ runs:
4047
4148
- name: Setup ccache on Windows
4249
if: ${{ runner.os == 'Windows' }}
43-
uses: protocolbuffers/protobuf-ci/internal/ccache-setup-windows@v1
50+
uses: ./../../_actions/current/internal/ccache-setup-windows
4451
- name: Setup ccache on Mac
4552
if: ${{ runner.os == 'macOS' }}
4653
shell: bash

cross-compile-protoc/action.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,15 @@ outputs:
3131
runs:
3232
using: 'composite'
3333
steps:
34+
- name: Symlink current Actions repo
35+
env:
36+
GH_ACTION_DIR: ${{ github.workspace }}/../../_actions/${{ github.action_repository }}/${{ github.action_ref }}/
37+
GH_ACTION_CLONE: ${{ github.workspace }}/../../_actions/current
38+
shell: bash
39+
run: ln -fs $GH_ACTION_DIR $GH_ACTION_CLONE
40+
3441
- name: Cross compile protoc for ${{ inputs.architecture }}
35-
uses: protocolbuffers/protobuf-ci/bazel-docker@v1
42+
uses: ./../../_actions/current/bazel-docker
3643
with:
3744
credentials: ${{ inputs.credentials }}
3845
bazel-cache: xcompile-protoc/${{ inputs.architecture }}

docker/action.yml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,19 @@ inputs:
3939
runs:
4040
using: 'composite'
4141
steps:
42+
- name: Symlink current Actions repo
43+
env:
44+
GH_ACTION_DIR: ${{ github.workspace }}/../../_actions/${{ github.action_repository }}/${{ github.action_ref }}/
45+
GH_ACTION_CLONE: ${{ github.workspace }}/../../_actions/current
46+
shell: bash
47+
run: ln -fs $GH_ACTION_DIR $GH_ACTION_CLONE
48+
4249
- name: Setup Runner
43-
uses: protocolbuffers/protobuf-ci/internal/setup-runner@v1
50+
uses: ./../../_actions/current/internal/setup-runner
4451

4552
- name: Update stale files using Bazel
4653
if: ${{ !inputs.skip-staleness-check }}
47-
uses: protocolbuffers/protobuf-ci/bazel-docker@v1
54+
uses: ./../../_actions/current/bazel-docker
4855
with:
4956
image: us-docker.pkg.dev/protobuf-build/containers/common/linux/bazel:5.1.1-aec4d74f2eb6938fc53ef7d9a79a4bf2da24abc1
5057
credentials: ${{ inputs.credentials }}
@@ -57,7 +64,7 @@ runs:
5764
run: echo "DOCKER_RUN_FLAGS=--platform ${{inputs.platform}}" >> $GITHUB_ENV
5865

5966
- name: Run Docker
60-
uses: protocolbuffers/protobuf-ci/internal/docker-run@v1
67+
uses: ./../../_actions/current/internal/docker-run
6168
with:
6269
image: ${{ inputs.image }}
6370
command: ${{ inputs.command }}

internal/bazel-setup/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,6 @@ runs:
8484
echo "bazel-startup-flags=$BAZEL_STARTUP_FLAGS" >> $GITHUB_OUTPUT
8585
8686
- name: Restore Bazel repository cache
87-
uses: protocolbuffers/protobuf-ci/internal/repository-cache-restore@v1
87+
uses: ./../../_actions/current/internal/repository-cache-restore
8888
with:
8989
bazel-cache: ${{ inputs.bazel-cache }}

0 commit comments

Comments
 (0)