Commit graph

13 commits

Author SHA1 Message Date
Brian C. Lane
d30cbde6f8 workflows: Switch utility workflows to using ubuntu-24.04
Pin the os version at 24.04 to avoid unexpected changes that can happen
when using ubuntu-latest
2025-02-12 22:23:32 +00:00
Ondřej Budai
b3123a1c19 github: prevent script injections via PR branch names
Prior this commit, ${{ github.event.workflow_run.head_branch }} got
expanded in the bash script. A malicious actor could inject
an arbitrary shell script. Since this action has access to a token
with write rights the malicious actor can easily steal this token.

This commit moves the expansion into an env block where such an
injection cannot happen. This is the preferred way according to the
github docs:
https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions#using-an-intermediate-environment-variable
2024-12-03 18:40:04 +01:00
Brian C. Lane
6549bf1992 trigger-gitlab.yml: Bump actions/checkout to v4 2024-04-10 01:32:51 +02:00
Christian Kellner
58bafaad98 ci: upgrade to actions/checkout@v3
This uses the new node 16 version (see [1]), which is the future proof
version, since node 12 will be deprecated by summer 2023 (see [2]).

[1] upstream commits:
8f9e05e482
a12a3943b4

[2] https://github.blog/changelog/2022-09-22-github-actions-all-actions-will-begin-running-on-node16-instead-of-node12/
2022-11-02 00:14:57 +01:00
Simon de Vlieger
ace6c3524b ci: push tags to gitlab
Tags are missing from GitLab (I pushed them once manually) while they
should really be there to be a full mirror.
2022-06-30 10:50:10 +02:00
Jakub Rusz
b7a9e9c5a3 workflows/trigger-gitlab: run Gitlab CI in new image-builder project
We have a new project in Gitlab
https://gitlab.com/redhat/services/products/image-builder/ci/osbuild
and we want to run the CI there instead.
2022-04-14 14:42:50 +02:00
Ondřej Budai
2f1b5d72dd trigger-gitlab: do not interpret the fetch_pulls outputs
Here documents are by default interpreted. Quoting the delimiter prevents
that.

See https://stackoverflow.com/questions/27920806/how-to-avoid-heredoc-expanding-variables
2021-10-21 11:35:08 +02:00
Sanne Raymaekers
79f842d4e7 .github: Write PR data to a file first in trigger-gitlab
Using echo breaks if any PR body contains a `'` character.
2021-10-07 10:07:41 +02:00
Christian Kellner
ebb7a982f8 ci: trigger gitlab from checks not tests
Use the "Checks" workflow to trigger gitlab; this workflow should
be much quicker to complete and thus the gitlab ci will trigger
earlier leading to a more parallel ci run.
2021-09-29 20:07:59 +02:00
Sanne Raymaekers
706e1ce243 .github: Get PR number from sha
Sadly `github.event.workflow_run.pull_requests` is empty if the pull
request was opened from another fork. Use the sha to find an open PR,
otherwise assume it's a branch.
2021-09-29 13:24:46 +02:00
Sanne Raymaekers
1c9fd1cf99 .github: Use the workflow_run event data in trigger-gitlab
This workflow doesn't have access to the original pull request event
that resulted in this workflow being triggered.

Simply use `head_sha` which will contain the PR sha if it was triggered
by a PR's workflow, or the branch sha if it was triggered from a
branch's workflow.
2021-09-27 16:25:45 +02:00
Christian Kellner
ea2ee10268 ci: trigger gitlab ci via workflow run event
The `workflow_run` event is triggered either when a workflow was
requested or complete (see `types`). We can use this event as a
trigger for the gitlab ci conditioning on a successful workflow
run of the main tests ("Tests" workflow). This will ensure that,
with outside contributor protection turned o, no secrets are
leaked via PRs from non-contributors, but also that gitlab ci is
run for those PRs once they were manually allowed to run.
The only downside is that now the gitlab ci will only run after
the main workflow ("Tests) has completed and thus serializing
both CI runs. OTOH gitlab CI is quite intense so maybe this is
not so bad after all. If in the future we want to parallelize
both CI runs we could have a third "precheck" condition with
maybe the spell checker and the pylint tests that the main tests
as well as the gitlab ci run depend on.
2021-09-24 17:51:40 +02:00
Jakub Rusz
e5d599d8ee ci: add Gitlab CI
This is an inital commit that enables the use of Gitlab CI.
2021-06-30 19:54:37 +02:00