geolexica / isotc211-glossary

ISO/TC 211 MLGT Online Concepts
2 stars 8 forks source link

add check for downstream repos dispatch #39

Closed HassanAkbar closed 11 months ago

HassanAkbar commented 11 months ago

Currently, the deployment was getting triggered for isotc211.geolexica.org every time a commit was added to any PR and it was failing. e.g -> https://github.com/geolexica/isotc211.geolexica.org/actions/runs/7136063729

So added the check to only trigger downstream repos when something is merged in main or staging or a tag is added.

closes geolexica/isotc211.geolexica.org#201

strogonoff commented 11 months ago

@HassanAkbar I’m not sure if I’m missing something, but what is the actual reason deployment was failing?

HassanAkbar commented 11 months ago

From github documentation of GITHUB_REF

The fully-formed ref of the branch or tag that triggered the workflow run. For workflows triggered by push, this is the branch or
tag ref that was pushed. For workflows triggered by pull_request, this is the pull request merge branch. For workflows
triggered by release, this is the release tag created. For other triggers, this is the branch or tag ref that triggered the workflow
run. This is only set if a branch or tag is available for the event type. The ref given is fully-formed, meaning that for branches
the format is refs/heads/<branch_name>, for pull requests it is refs/pull/<pr_number>/merge, and for tags it is
refs/tags/<tag_name>. For example, refs/heads/feature-branch-1.

@strogonoff we were dispatching deploy action to isotc211.geolexica.org which tries to fetch the branch using GITHUB_REF and because there was no branch named like refs/pull/<pr_number>/merge so the CI was failing.

Screenshot 2023-12-13 at 5 59 34 PM