Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/lvjiaxuan/github-action-templates

My frequently used GitHub action templates.
https://github.com/lvjiaxuan/github-action-templates

github-action publish release reuseable-workflow update-dependency

Last synced: about 1 month ago
JSON representation

My frequently used GitHub action templates.

Awesome Lists containing this project

README

        

# Workflow Templates

1. [lvr-release](.github/workflows/lvr-release.yml)
2. [lvr-publish](.github/workflows/lvr-publish.yml)
3. [update-deps](.github/workflows/update-deps.yml)

# Usage

## Release and Publish are usually used together.

Based on my own [release tool](github.com/lvjiaxuan/release).

1. The release workflow resolves release's notes from `CHANGELOG.md`.
2. The publish workflow supports syncing published pkgages to cnpm.

```yml
name: Release and Publish

on:
push:
tags:
- v*

jobs:
release:
permissions:
contents: write
uses: lvjiaxuan/github-action-templates/.github/workflows/lvr-release.yml@main
secrets: inherit

publish:
uses: lvjiaxuan/github-action-templates/.github/workflows/lvr-publish.yml@main
with:
sync_cnpm: true
secrets: inherit
```

## Update dependencies

### Ways of defining the user's email, which is a required param.

1. A hard code on inputs. Recommend using GitHub's [noreply email](https://github.com/settings/emails).
2. If no `inputs.email` is provided, auto-detect `vars.ACTOR_EMAIL` by default. Reference to actions secrets and variables :point_right: https://github.com/{actor}/{repo}/settings/secrets/actions .

> [!TIP]
> :point_right: [cron syntax help](https://crontab.guru/examples.html)

```yml
name: Update Dependencies

permissions:
pull-requests: write
contents: write

on:
workflow_dispatch: {}
schedule:
- cron: 0 0 * * SAT

jobs:
update-deps:
uses: lvjiaxuan/github-action-templates/.github/workflows/update-deps.yml@main
with:
email: [email protected] # Explicitly set `inputs.email`, if `vars.ACTOR_EMAIL` isn't set.
```

[more inputs](https://github.com/lvjiaxuan/github-action-templates/blob/main/.github/workflows/update-deps.yml)

# Other recommended actions

1. [update-repository-description](https://github.com/zhengbangbo/update-repository-description) by @zhengbangbo