Skip to content

Commit b289df5

Browse files
committed
fix: replace github.event.inputs with inputs context for reusable workflows
1 parent 04b5ec2 commit b289df5

2 files changed

Lines changed: 18 additions & 27 deletions

File tree

.github/workflows/generate_Robotics_Academy.yml

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -92,20 +92,16 @@ jobs:
9292
name: Run Test and Update Docker Image
9393
runs-on: ubuntu-latest
9494
env:
95-
TAG: ${{ github.event.inputs.tag }}
95+
TAG: ${{ inputs.tag }}
9696
steps:
9797
- name: Save the version tag
9898
run: echo "TAG=${TAG#v}" >> $GITHUB_ENV
9999
- run: echo ${TAG}
100-
- name: Debug Outputs for Bug Proof
101-
run: |
102-
echo "WRONG (github property): ${{ github.event.inputs.RI }}"
103-
echo "RIGHT (passed value): ${{ inputs.RI }}"
104-
100+
- name: Verify Fix
101+
run: echo "SUCCESS - Using passed input RI is ${{ inputs.RI }}"
105102
- name: Check out the repo # checking our the code at current commit that triggers the workflow
106103
uses: actions/checkout@v3
107104
with:
108-
ref: ${{ github.event.inputs.branch-webserver-id }}
109105
fetch-depth: 1
110106

111107
- name: Set up QEMU
@@ -124,23 +120,23 @@ jobs:
124120
run: |
125121
sudo apt-get update
126122
cd scripts/RADI
127-
if [ "${{ github.event.inputs.ROS }}" == "humble" ]; then
123+
if [ "${{ inputs.ROS }}" == "humble" ]; then
128124
docker build --build-arg TARGETARCH=amd64 -f Dockerfile.dependencies_humble -t jderobot/robotics-applications:dependencies-humble .
129125
else
130126
echo "Incorrect ROS version"
131127
fi
132128
- name: Build and push RADI
133129
run: |
134130
cd scripts/RADI
135-
if [ "${{ github.event.inputs.ROS }}" == "humble" ]; then
131+
if [ "${{ inputs.ROS }}" == "humble" ]; then
136132
docker build --no-cache -f Dockerfile.humble \
137-
--build-arg ROBOTICS_ACADEMY=${{ github.event.inputs.RA }}\
138-
--build-arg ROBOTICS_INFRASTRUCTURE=${{ github.event.inputs.RI }} \
139-
--build-arg RAM=${{ github.event.inputs.RAM }} \
140-
--build-arg ROS_DISTRO=${{ github.event.inputs.ROS }} \
133+
--build-arg ROBOTICS_ACADEMY=${{ inputs.RA }}\
134+
--build-arg ROBOTICS_INFRASTRUCTURE=${{ inputs.RI }} \
135+
--build-arg RAM=${{ inputs.RAM }} \
136+
--build-arg ROS_DISTRO=${{ inputs.ROS }} \
141137
--build-arg IMAGE_TAG=${TAG} \
142-
--build-arg ACADEMY_OWNER=${{ github.event.inputs.academy_owner }} \
143-
--build-arg INFRA_OWNER=${{ github.event.inputs.infra_owner }} \
138+
--build-arg ACADEMY_OWNER=${{ inputs.academy_owner }} \
139+
--build-arg INFRA_OWNER=${{ inputs.infra_owner }} \
144140
-t jderobot/robotics-academy:${TAG} .
145141
docker push jderobot/robotics-academy:${TAG}
146142
else

.github/workflows/generate_Robotics_Academy_Database.yml

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -67,20 +67,16 @@ jobs:
6767
name: Run Test and Update Docker Image
6868
runs-on: ubuntu-latest
6969
env:
70-
TAG: ${{ github.event.inputs.tag }}
70+
TAG: ${{ inputs.tag }}
7171
steps:
7272
- name: Save the version tag
7373
run: echo "TAG=${TAG#v}" >> $GITHUB_ENV
7474
- run: echo ${TAG}
75-
- name: Debug Outputs for Bug Proof
76-
run: |
77-
echo "WRONG (github property): ${{ github.event.inputs.RI }}"
78-
echo "RIGHT (passed value): ${{ inputs.RI }}"
79-
75+
- name: Verify Fix
76+
run: echo "SUCCESS - Using passed input RI is ${{ inputs.RI }}"
8077
- name: Check out the repo # checking our the code at current commit that triggers the workflow
8178
uses: actions/checkout@v3
8279
with:
83-
ref: ${{ github.event.inputs.branch-webserver-id }}
8480
fetch-depth: 1
8581

8682
- name: Set up QEMU
@@ -95,16 +91,15 @@ jobs:
9591
username: ${{ secrets.DOCKER_USERNAME }}
9692
password: ${{ secrets.DOCKER_PASSWORD }}
9793

98-
9994
- name: Build and push RA database
10095
run: |
10196
cd scripts/RADI
10297
docker build --no-cache -f Dockerfile.database \
10398
--build-arg IMAGE_TAG=${TAG}\
104-
--build-arg ROBOTICS_ACADEMY=${{ github.event.inputs.RA }}\
105-
--build-arg ROBOTICS_INFRASTRUCTURE=${{ github.event.inputs.RI }} \
106-
--build-arg ACADEMY_OWNER=${{ github.event.inputs.academy_owner }} \
107-
--build-arg INFRA_OWNER=${{ github.event.inputs.infra_owner }} \
99+
--build-arg ROBOTICS_ACADEMY=${{ inputs.RA }}\
100+
--build-arg ROBOTICS_INFRASTRUCTURE=${{ inputs.RI }} \
101+
--build-arg ACADEMY_OWNER=${{ inputs.academy_owner }} \
102+
--build-arg INFRA_OWNER=${{ inputs.infra_owner }} \
108103
-t jderobot/robotics-database:${TAG} .
109104
docker push jderobot/robotics-database:${TAG}
110105
- name: Upload as Latest

0 commit comments

Comments
 (0)