mirror of
https://gitcode.com/gh_mirrors/gh/gh-action-pypi-publish.git
synced 2026-07-02 18:27:49 +00:00
Check repo ID instead of repo owner ID
This commit is contained in:
@@ -8,18 +8,18 @@ REQUIRED = 'required'
|
||||
EVENT = os.environ['EVENT']
|
||||
REF = os.environ['REF']
|
||||
REPO = os.environ['REPO']
|
||||
REPO_OWNER_ID = os.environ['REPO_OWNER_ID']
|
||||
REPO_OWNER_ID_PYPA = '647025'
|
||||
REPO_ID = os.environ['REPO_ID']
|
||||
REPO_ID_GH_ACTION = '178055147'
|
||||
|
||||
|
||||
def set_image(event: str, ref: str, repo: str, repo_owner_id: str) -> str:
|
||||
if event == 'pull_request' and repo_owner_id == REPO_OWNER_ID_PYPA:
|
||||
def set_image(event: str, ref: str, repo: str, repo_id: str) -> str:
|
||||
if event == 'pull_request' and repo_id == REPO_ID_GH_ACTION:
|
||||
return '../../../Dockerfile'
|
||||
docker_ref = ref.replace('/', '-')
|
||||
return f'docker://ghcr.io/{repo}:{docker_ref}'
|
||||
|
||||
|
||||
image = set_image(EVENT, REF, REPO, REPO_OWNER_ID)
|
||||
image = set_image(EVENT, REF, REPO, REPO_ID)
|
||||
|
||||
action = {
|
||||
'name': '🏃',
|
||||
|
||||
Reference in New Issue
Block a user