Skip to content

Commit 7ea8313

Browse files
committed
Check repo ID instead of repo owner ID
1 parent f51682f commit 7ea8313

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

action.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -113,17 +113,17 @@ runs:
113113
# https://github.com/actions/runner/issues/2473
114114
REF=${{ env.ACTION_REF || env.PR_REF || github.ref_name }}
115115
REPO=${{ env.ACTION_REPO || env.PR_REPO || github.repository }}
116-
REPO_OWNER_ID=${{ env.PR_REPO_OWNER_ID || github.repository_owner_id }}
116+
REPO_ID=${{ env.PR_REPO_ID || github.repository_id }}
117117
echo "ref=$REF" >>"$GITHUB_OUTPUT"
118118
echo "repo=$REPO" >>"$GITHUB_OUTPUT"
119-
echo "repo-owner-id=$REPO_OWNER_ID" >>"$GITHUB_OUTPUT"
119+
echo "repo-id=$REPO_ID" >>"$GITHUB_OUTPUT"
120120
shell: bash
121121
env:
122122
ACTION_REF: ${{ github.action_ref }}
123123
ACTION_REPO: ${{ github.action_repository }}
124124
PR_REF: ${{ github.event.pull_request.head.ref }}
125125
PR_REPO: ${{ github.event.pull_request.head.repo.full_name }}
126-
PR_REPO_OWNER_ID: ${{ github.event.pull_request.base.repo.owner.id }}
126+
PR_REPO_ID: ${{ github.event.pull_request.base.repo.id }}
127127
- name: Check out action repo
128128
uses: actions/checkout@v4
129129
with:
@@ -138,7 +138,7 @@ runs:
138138
EVENT: ${{ github.event_name }}
139139
REF: ${{ steps.set-repo-and-ref.outputs.ref }}
140140
REPO: ${{ steps.set-repo-and-ref.outputs.repo }}
141-
REPO_OWNER_ID: ${{ steps.set-repo-and-ref.outputs.repo-owner-id }}
141+
REPO_ID: ${{ steps.set-repo-and-ref.outputs.repo-id }}
142142
shell: bash
143143
working-directory: action-repo
144144
- name: Run Docker container

create-docker-action.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,18 @@
88
EVENT = os.environ['EVENT']
99
REF = os.environ['REF']
1010
REPO = os.environ['REPO']
11-
REPO_OWNER_ID = os.environ['REPO_OWNER_ID']
12-
REPO_OWNER_ID_PYPA = '647025'
11+
REPO_ID = os.environ['REPO_ID']
12+
REPO_ID_GH_ACTION = '178055147'
1313

1414

15-
def set_image(event: str, ref: str, repo: str, repo_owner_id: str) -> str:
16-
if event == 'pull_request' and repo_owner_id == REPO_OWNER_ID_PYPA:
15+
def set_image(event: str, ref: str, repo: str, repo_id: str) -> str:
16+
if event == 'pull_request' and repo_id == REPO_ID_GH_ACTION:
1717
return '../../../Dockerfile'
1818
docker_ref = ref.replace('/', '-')
1919
return f'docker://ghcr.io/{repo}:{docker_ref}'
2020

2121

22-
image = set_image(EVENT, REF, REPO, REPO_OWNER_ID)
22+
image = set_image(EVENT, REF, REPO, REPO_ID)
2323

2424
action = {
2525
'name': '🏃',

0 commit comments

Comments
 (0)