Skip to content

Commit

Permalink
fix: semantic-release task condition (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
StinkyBenji authored Oct 26, 2023
1 parent 44633ab commit 7c93cbb
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 9 deletions.
7 changes: 5 additions & 2 deletions .tekton/ansible-ee-pipeline.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -117,16 +117,19 @@ spec:

- name: semantic-release
when:
- input: "$(tasks.fetch-repository.results.branch)"
- input: "{{ source_branch }}"
operator: in
values: ["HEAD"]
values: ["main"]
runAfter:
- ee-sanity-test
taskRef:
name: semantic-release
workspaces:
- name: source
workspace: source
params:
- name: source-branch
value: "{{ source_branch }}"

workspaces:
- name: source
Expand Down
13 changes: 8 additions & 5 deletions .tekton/tasks/semantic-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ spec:
type: string
description: name of the secret holding the github token and npm token
default: semantic-release-auth
- name: source-branch
type: string
description: the source-branch that semantic-release will run on
workspaces:
- name: source
steps:
Expand All @@ -42,14 +45,14 @@ spec:
workingDir: $(workspaces.source.path)
script: |
#!/usr/bin/env sh
echo "npm version: $(npm --version)"
echo "npx version: $(npx --version)"
# install all the dependencies for semantic-release
npm clean-install
git config --global --add safe.directory $(workspaces.source.path)
echo "Fetch origin"
git fetch origin
echo "Checkout the $(params.source-branch)"
git checkout $(params.source-branch)
# run the semantic-release
npx semantic-release --no-ci
npx semantic-release --no-ci --branches $(params.source-branch)
10 changes: 8 additions & 2 deletions release.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ module.exports = {
],
parserOpts: {
noteKeywords: ["BREAKING CHANGE", "BREAKING CHANGES", "BREAKING"],
noteKeywords: ["feat", "feature"]
noteKeywords: ["feat", "feature"],
},
},
],
Expand All @@ -25,6 +25,12 @@ module.exports = {
],
"@semantic-release/git",
"@semantic-release/github",
"@codedependant/semantic-release-docker",
// [
// "@codedependant/semantic-release-docker", {
// dockerContext: "examples/ansible-ee",
// dockerRegistry: "quay.io",
// dockerImage: "custom-ansible-ee",
// }
// ]
],
};

0 comments on commit 7c93cbb

Please sign in to comment.