Skip to content

Commit

Permalink
GitHub action: add branch handling
Browse files Browse the repository at this point in the history
  • Loading branch information
jefferya committed Jul 9, 2024
1 parent add6d6a commit 1b15634
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 3 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/push.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
name: Build and publish

on:
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#onpushpull_requestbranchestags
push:
# branches: [ "main" ]
branches:
- '**' # all branches; with or without '/'
- '!main' # exclude main
# Publish semver tags as releases.
tags: [ 'v*.*.*' ]
pull_request:
Expand Down
18 changes: 16 additions & 2 deletions README.test.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,29 @@
# How to test

## Act testing GitHub Actions

https://nektosact.com/usage/index.html

To simulate
### To simulate a git tag

* Create a file with the following:
*
```json
{
"ref": "refs/tags/v1.99.91"
}
```

../tmp2/act -W .github/workflows/push.yml -s GITHUB_TOKEN push -e /tmp/event_tag.json
* `../tmp2/act -W .github/workflows/push.yml -s GITHUB_TOKEN push -e /tmp/event_tag.json`

### To simulate a git branch

* Create a file with the following (might work if currently in a branch)

``` json
{
"ref": "refs/heads/leaf-3.0.8"
}
```

* `../tmp2/act -W .github/workflows/push.yml -s GITHUB_TOKEN push -e /tmp/event_branch.json`

0 comments on commit 1b15634

Please sign in to comment.