Skip to content

CmampTask7965_Fix_the_triggering_of_the_release_Docker_images_workflow#1096

Draft
dremdem wants to merge 12 commits intomasterfrom
CmampTask7965_Fix_the_triggering_of_the_release_Docker_images_workflow
Draft

CmampTask7965_Fix_the_triggering_of_the_release_Docker_images_workflow#1096
dremdem wants to merge 12 commits intomasterfrom
CmampTask7965_Fix_the_triggering_of_the_release_Docker_images_workflow

Conversation

@dremdem
Copy link
Contributor

@dremdem dremdem commented Nov 10, 2025

#7965

  • Fix the triggering of the release Docker images workflow and update the token to GITHUB_TOKEN only

@dremdem dremdem self-assigned this Nov 10, 2025
@dremdem dremdem requested a review from heanhsok November 10, 2025 17:56
@dremdem dremdem added the PR for reviewers The PR needs to be reviewed by RPs label Nov 10, 2025
on:
# Trigger on a merged PR, with restrictions applied at the job level.
pull_request:
types: [closed]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this CI pipeline going to appear in all the closed PR?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but there’s an if condition here:

if: >
(
github.event.pull_request.merged == true
&& contains(github.event.pull_request.labels.*.name, 'Automated release')
) || github.event_name == 'workflow_dispatch'
)

So, the workflow will be triggered, but the job itself won’t run unless the condition is met.

Copy link
Contributor

@heanhsok heanhsok Nov 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think let's not have it triggered and shown for non relevant PRs

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't find a way to prevent the GitHub workflow from triggering when we merge a PR with the Automated build label.
The only solution I’ve found is to trigger on any merged or closed PR and then filter them out at the job level.

Another possible approach could be:

  • Keep this GitHub workflow as a manual run
  • Add an extra manual step in our pipeline to execute this workflow

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about triggered it on merged to master when the changelog.txt is changed?

We can do path filtering

https://github.com/causify-ai/csfy/blob/f7b4afa69bf24b6f4ffedd807bf1825fdf143e09/.github/workflows/platform-ci.yml#L4-L8

Comment on lines 46 to 49
- name: Login to GHCR
run: |
echo "${{ secrets.GH_ACTION_ACCESS_TOKEN || secrets.GITHUB_TOKEN }}" \
echo "${{ secrets.GITHUB_TOKEN }}" \
| docker login ghcr.io -u ${{ github.actor }} --password-stdin
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also could we see how the PR would like when it's filed by the GH app as well?

Copy link
Contributor Author

@dremdem dremdem Nov 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch!
I tried to make and test another PR: #1099 and found:

However, the GITHUB_TOKEN can only access resources within the workflow's repository. If you need to access additional resources, such as resources in an organization or in another repository, you can use a GitHub App.

The question is: who is able to set up these variables and secrets in the helpers repo?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

which variables need to be set?

Copy link
Contributor Author

@dremdem dremdem Nov 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • .github/workflows/sprint_iteration.yml

Like in the:
https://github.com/causify-ai/csfy/blob/f7b4afa69bf24b6f4ffedd807bf1825fdf143e09/.github/workflows/sprint_iteration.yml#L25-L26

      - name: Generate GitHub App token
        uses: actions/create-github-app-token@v1
        id: app-token
        with:
          app-id: ${{ vars.GH_APP_ID }}
          private-key: ${{ secrets.GH_APP_PRIVATE_KEY }}
          owner: ${{ github.repository_owner }}

We need to set:

  • variable: GH_APP_ID
  • secret: GH_APP_PRIVATE_KEY

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see they are already set as ORG level secrets/vars so they should already be accessible by //helpers right?

Copy link
Contributor

@heanhsok heanhsok Nov 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could also try to test it on //csfy too

Copy link
Contributor Author

@dremdem dremdem Nov 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see they are already set as ORG level secrets/vars so they should already be accessible by //helpers right?

I tried to debug in in the ssh-session inside the GitHub workflow run, but they are empty:
the ssh-session step to see the variable and the secret:

- name: ssh
uses: lhotari/action-upterm@v1
env:
app-id: ${{ vars.GH_APP_ID }}
private-key: ${{ secrets.GH_APP_PRIVATE_KEY }}
owner: ${{ github.repository_owner }}

  • checked inside the ssh-session:
runner@runnervmw9dnm:~/work/helpers/helpers$ env | grep app
app-id=
runner@runnervmw9dnm:~/work/helpers/helpers$ env | grep private
private-key=
runner@runnervmw9dnm:~/work/helpers/helpers$

Probably need to set permission for these variable and secret on the repo level also.
https://docs.github.com/en/actions/how-tos/write-workflows/choose-what-workflows-do/use-secrets?utm_source=chatgpt.com#reviewing-access-to-organization-level-secrets

@heanhsok
Can you pls check it.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They should be there now. I don't have perm to check that but I could replicate them in //helpers.
Cloud you try again?

@dremdem dremdem marked this pull request as draft November 14, 2025 17:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PR for reviewers The PR needs to be reviewed by RPs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants