Skip to content

How do I trigger a commit only for a particular user? #26909

Answered by shrink
aoisensi asked this question in Actions
Discussion options

You must be logged in to vote

The github.actor variable refers to the GitHub user but in your case weblate is not a GitHub user. You can find the specifics of the supported variables here: https://docs.github.com/en/actions/reference/context-and-expression-syntax-for-github-actions#github-context

There is an action available called rlespinasse/git-commit-data-action which can extract the data you’re interested in and you can then use that to compare against. I’ve attached an example workflow below that will only release when the commit comes from weblate :slight_smile:

name: Release localization data

on: push

jobs:

Create a job with the id restrict which obtains the committer name

restrict:
runs-on: ubuntu-latest
# A …

Replies: 4 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Actions Build, test, and automate your deployment pipeline with world-class CI/CD Product Feedback
3 participants