File tree 4 files changed +16
-5
lines changed
4 files changed +16
-5
lines changed Original file line number Diff line number Diff line change 46
46
run : |
47
47
echo "::set-output name=ver::$(jq --raw-output .version metadata.json)"
48
48
49
- - name : " Commit changes "
49
+ - name : " Check if a release is necessary "
50
50
if : ${{ github.repository_owner == 'puppetlabs' }}
51
+ id : check
52
+ run : |
53
+ git diff --quiet CHANGELOG.md && echo "::set-output name=release::false" || echo "::set-output name=release::true"
54
+
55
+ - name : " Commit changes"
56
+ if : ${{ github.repository_owner == 'puppetlabs' && steps.check.outputs.release == 'true' }}
51
57
run : |
52
58
git config --local user.email "${{ github.repository_owner }}@users.noreply.github.com"
53
59
git config --local user.name "GitHub Action"
57
63
- name : Create Pull Request
58
64
id : cpr
59
65
uses : puppetlabs/peter-evans-create-pull-request@v3
60
- if : ${{ github.repository_owner == 'puppetlabs' }}
66
+ if : ${{ github.repository_owner == 'puppetlabs' && steps.check.outputs.release == 'true' }}
61
67
with :
62
68
token : ${{ secrets.GITHUB_TOKEN }}
63
69
commit-message : " Release prep v${{ steps.gv.outputs.ver }}"
73
79
labels : " maintenance"
74
80
75
81
- name : PR outputs
76
- if : ${{ github.repository_owner == 'puppetlabs' }}
82
+ if : ${{ github.repository_owner == 'puppetlabs' && steps.check.outputs.release == 'true' }}
77
83
run : |
78
84
echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}"
79
85
echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}"
Original file line number Diff line number Diff line change 7
7
optional :
8
8
" :development " :
9
9
- gem : github_changelog_generator
10
+ Rakefile :
11
+ changelog_user : puppetlabs
12
+ changelog_max_issues : 500
10
13
spec/spec_helper.rb :
11
14
mock_with : " :rspec"
12
15
coverage_report : true
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ require 'puppet-strings/tasks' if Bundler.rubygems.find_name('puppet-strings').a
10
10
11
11
def changelog_user
12
12
return unless Rake . application . top_level_tasks . include? "changelog"
13
- returnVal = nil || JSON . load ( File . read ( 'metadata.json' ) ) [ 'author' ]
13
+ returnVal = "puppetlabs" || JSON . load ( File . read ( 'metadata.json' ) ) [ 'author' ]
14
14
raise "unable to find the changelog_user in .sync.yml, or the author in metadata.json" if returnVal . nil?
15
15
puts "GitHubChangelogGenerator user:#{ returnVal } "
16
16
returnVal
43
43
44
44
PuppetLint . configuration . send ( 'disable_relative' )
45
45
46
+
46
47
if Bundler . rubygems . find_name ( 'github_changelog_generator' ) . any?
47
48
GitHubChangelogGenerator ::RakeTask . new :changelog do |config |
48
49
raise "Set CHANGELOG_GITHUB_TOKEN environment variable eg 'export CHANGELOG_GITHUB_TOKEN=valid_token_here'" if Rake . application . top_level_tasks . include? "changelog" and ENV [ 'CHANGELOG_GITHUB_TOKEN' ] . nil?
49
50
config . user = "#{ changelog_user } "
50
51
config . project = "#{ changelog_project } "
51
52
config . since_tag = "v3.0.0"
53
+ config . max_issues = 500
52
54
config . future_release = "#{ changelog_future_release } "
53
55
config . exclude_labels = [ 'maintenance' ]
54
56
config . header = "# Change log\n \n All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org)."
Original file line number Diff line number Diff line change 77
77
}
78
78
],
79
79
"template-url" : " https://github.com/puppetlabs/pdk-templates.git#main" ,
80
- "template-ref" : " heads/main-0-g2381db6 " ,
80
+ "template-ref" : " heads/main-0-gfe51af3 " ,
81
81
"pdk-version" : " 2.1.1"
82
82
}
You can’t perform that action at this time.
0 commit comments