I have 3 different workflows in a project configured at top as:
plan_streamline.yml
name: plan
on:
push:
branches:
- main
workflow_dispatch:
...
terrform_import.yml
name: terraform_import
on: workflow_dispatch
...
plan.yml
on:
push:
branches:
- main
workflow_dispatch:
But within the github action I do not see the ability to manually execute any of the workflows, as I should be seeing something like https://github.blog/changelog/2020-07-06-github-actions-manual-triggers-with-workflow_dispatch/
What is wrong with my workflow configuration?
Merged the branch with the new workflows to the default branch so that option appears now
Related
I have a workflow, main.yml:
name: Build Main
on:
push:
branches: main
pull_request:
branches:
- main
types: [opened, synchronize, reopened, labeled]
I also have this other one, feature.yml:
name: Build Feature
on:
push:
branches: feature/**
When I'm on a feature branch (feature/NN-my-feature), and I push a commit from Visual Studio Code, both the workflows run.
Looking at the Actions in GitHub, the main.yml is triggered by a "pull_request".
I don't understand why/how the pull_request on "main" is triggered.
Any to pass a variable (of sorts) for the version of a reusable workflow
For example ,if I have this workflow:
name: caller-workflow
on:
pull_request:
push:
branches:
- master
# 2
jobs:
call-the-workflow:
uses: action-foobar/action-testing/.github/workflows/called_workflow.yml#${{github.ref_name}}
with:
TRIGGER_EVENT : ${{ github.event_name }}
from the example above
`uses: action-foobar/action-testing/.github/workflows/called_workflow.yml#${{github.ref_name}}` using a `${{github.ref_name}}`
instead of a pinned reference.
Would like to be able to call the reusable workflow, using a reference (Thereby I could do easy automation on pull requests or any branch (for pipeline or CI development)
No - it's impossible unfortunately.
name: blabla bacon n eggs
on:
pull_request:
branches:
- basickarl/gh-actions-pr
defaults:
run:
shell: bash
jobs:
somting:
runs-on: ubuntu-latest
steps:
- run: echo "testy"
I have pushed my code on the branch stated to the origin repo in github. I have created a pull request. I updated some code on the branch and pushed, but the actions is not triggering? How does one trigger a github action workflow when updating a pull request?
The updates to the branch I am making is the workflow file itself.
Here is an example repo: https://github.com/basickarl/github-actions/actions/workflows/test.yaml
For some reason only on: [pull_request] seems to work.
Use types: [synchronize] under on: pull-request:
I have two workflows. They have the following:
my-prod-ci
on:
pull_request:
branches:
- master
jobs:
myjob:
my-dev-ci
on:
pull_request:
branches:
- develop
jobs:
myjob:
The status checks in the repo is set to use myjob
When I create a PR from feature branch to develop branch, both the workflows are run. I only want my-dev-ci to run.
Similarly on creating a PR from develop to master branch, both workflows are run. I only want my-prod-ci to run.
Am I missing something?
Checking out the GitHub workflow syntax, I would try and add explicit branches pattern directives:
Example:
on:
pull_request:
branches:
- 'master'
- '!feature'
jobs:
myjob:
I'd like to trigger automatically a GitHub Action Workflow for each [assigned, opened, synchronize, reopened] Git Pull Request from side-branch into master.
In addition, Is there a way to checkout the code from the private repository of a PR via branch name?
Below you can find my GitHub Action workflow that I've tried but unfortunately when I open a PR from side-branch into master it didn't trigger at all.
on:
workflow_dispatch:
pull_request:
types: [assigned, opened, synchronize, reopened]
branches:
- master
jobs:
build-image:
name: Build Docker Image
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout#v2
with:
ref: ${{github.event.pull_request.head.sha}}
Is it possible, how can I do that?