Skip to content

Commit 1d85198

Browse files
committed
feat: setup tagpr
1 parent b6ef222 commit 1d85198

File tree

4 files changed

+104
-11
lines changed

4 files changed

+104
-11
lines changed

.github/workflows/ci.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: CI
33
on:
44
push:
55
branches:
6-
- master
6+
- main
77
pull_request:
88

99
jobs:
@@ -13,16 +13,16 @@ jobs:
1313

1414
steps:
1515
- name: Checkout
16-
uses: actions/checkout@v2
16+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
1717

1818
- name: Set up Ruby
19-
uses: ruby/setup-ruby@v1
19+
uses: ruby/setup-ruby@ab177d40ee5483edb974554986f56b33477e21d0 # v1.265.0
2020
with:
21-
ruby-version: 3.1
21+
ruby-version: ruby
2222
bundler-cache: true
2323

2424
- name: Run rubocop
25-
uses: reviewdog/action-rubocop@v1
25+
uses: reviewdog/action-rubocop@a434f50eaae1589b90edcb14cabf70555571577a # v1.11.0
2626
with:
2727
github_token: ${{ secrets.GITHUB_TOKEN }}
2828
reporter: github-pr-review
@@ -46,10 +46,10 @@ jobs:
4646

4747
steps:
4848
- name: Checkout
49-
uses: actions/checkout@v2
49+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
5050

5151
- name: Set up Ruby
52-
uses: ruby/setup-ruby@v1
52+
uses: ruby/setup-ruby@ab177d40ee5483edb974554986f56b33477e21d0 # v1.265.0
5353
with:
5454
ruby-version: ${{ matrix.ruby-version }}
5555
bundler-cache: true

.github/workflows/doc.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,18 @@ jobs:
1212
DISABLE_AWS_CLIENT_CHECK: true
1313
steps:
1414
- name: Checkout
15-
uses: actions/checkout@v2
15+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
1616

1717
- name: Set up Ruby
18-
uses: ruby/setup-ruby@v1
18+
uses: ruby/setup-ruby@ab177d40ee5483edb974554986f56b33477e21d0 # v1.265.0
1919
with:
20-
ruby-version: '2.7'
20+
ruby-version: ruby
2121
bundler-cache: true
2222

2323
- name: Generate document
2424
run: bundle exec bin/toolbox docgen > doc/resource_types.md
2525

26-
- uses: EndBug/add-and-commit@v7
26+
- uses: EndBug/add-and-commit@8c12ff729a98cfbcd3fe38b49f55eceb98a5ec02 # v7.5.0
2727
with:
2828
default_author: github_actions
2929
add: 'doc/resource_types.md'

.github/workflows/tagpr.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: tagpr
2+
on:
3+
push:
4+
branches:
5+
- main
6+
7+
jobs:
8+
tagpr:
9+
runs-on: ubuntu-latest
10+
outputs:
11+
tagpr-tag: ${{ steps.run-tagpr.outputs.tag }}
12+
permissions:
13+
contents: write
14+
pull-requests: write
15+
issues: write
16+
packages: write
17+
env:
18+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
19+
steps:
20+
- name: Check out source code
21+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
22+
with:
23+
fetch-depth: 0
24+
25+
- name: Set up Ruby
26+
uses: ruby/setup-ruby@ab177d40ee5483edb974554986f56b33477e21d0 # v1.265.0
27+
with:
28+
ruby-version: ruby
29+
bundler-cache: true
30+
31+
- id: run-tagpr
32+
name: Run tagpr
33+
uses: Songmu/tagpr@9c294c8b7b1815a5f3b7c61d6ee6aa50ac25b030 # v1.8.4
34+
35+
release:
36+
needs: tagpr
37+
if: needs.tagpr.outputs.tagpr-tag != ''
38+
runs-on: ubuntu-latest
39+
permissions:
40+
contents: write
41+
packages: write
42+
id-token: write
43+
env:
44+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
45+
steps:
46+
- name: Check out source code
47+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
48+
with:
49+
fetch-depth: 0
50+
51+
- name: Set up Ruby
52+
uses: ruby/setup-ruby@ab177d40ee5483edb974554986f56b33477e21d0 # v1.265.0
53+
with:
54+
ruby-version: ruby
55+
bundler-cache: true
56+
57+
- name: release gem
58+
uses: rubygems/release-gem@9fc8c0f9a461e67716cde28f188b9a5c029333a8 # v1

.tagpr

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# config file for the tagpr in git config format
2+
# The tagpr generates the initial configuration, which you can rewrite to suit your environment.
3+
# CONFIGURATIONS:
4+
# tagpr.releaseBranch
5+
# Generally, it is "main." It is the branch for releases. The pcpr tracks this branch,
6+
# creates or updates a pull request as a release candidate, or tags when they are merged.
7+
#
8+
# tagpr.versionFile
9+
# Versioning file containing the semantic version needed to be updated at release.
10+
# It will be synchronized with the "git tag".
11+
# Often this is a meta-information file such as gemspec, setup.cfg, package.json, etc.
12+
# Sometimes the source code file, such as version.go or Bar.pm, is used.
13+
# If you do not want to use versioning files but only git tags, specify the "-" string here.
14+
# You can specify multiple version files by comma separated strings.
15+
#
16+
# tagpr.vPrefix
17+
# Flag whether or not v-prefix is added to semver when git tagging. (e.g. v1.2.3 if true)
18+
# This is only a tagging convention, not how it is described in the version file.
19+
#
20+
# tagpr.changelog (Optional)
21+
# Flag whether or not changelog is added or changed during the release.
22+
#
23+
# tagpr.command (Optional)
24+
# Command to change files just before release.
25+
#
26+
# tagpr.tmplate (Optional)
27+
# Pull request template in go template format
28+
#
29+
# tagpr.release (Optional)
30+
# GitHub Release creation behavior after tagging [true, draft, false]
31+
# If this value is not set, the release is to be created.
32+
[tagpr]
33+
vPrefix = true
34+
releaseBranch = main
35+
versionFile = lib/awspec/version.rb

0 commit comments

Comments
 (0)