Skip to content

Commit deab662

Browse files
committed
Merge branch 'develop' into v2-lite
2 parents 379d4ea + 121c0ff commit deab662

File tree

11 files changed

+460
-308
lines changed

11 files changed

+460
-308
lines changed
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# install new gitstream-core version and open PR with new changes
2+
name: Bump gitstream-core
3+
run-name: Bump `gitstream-core` to `${{ inputs.version }}`
4+
5+
on:
6+
workflow_dispatch:
7+
inputs:
8+
version:
9+
description: Version number (ex. "2.1.20")
10+
required: true
11+
default: 2.1.20
12+
ticket:
13+
description: LINBEE-XXXX ticket number
14+
default: LINBEE-8514
15+
required: false
16+
description:
17+
description: Add a description for this version
18+
required: false
19+
jobs:
20+
publish_pr:
21+
name: Publish PR
22+
runs-on: ubuntu-latest
23+
steps:
24+
- uses: actions/checkout@v4
25+
26+
- name: Set version to ENV
27+
run: |
28+
echo "VERSION=${{ inputs.version }}" >> "$GITHUB_ENV"
29+
echo "BRANCH_NAME=${{ inputs.ticket }}-bump-gitstream-core-to-${{ inputs.version }}" >> "$GITHUB_ENV"
30+
31+
- name: Init npmrc
32+
run: |
33+
curl -H "X-JFrog-Art-API: ${{ secrets.ARTIFACTORY_API_KEY }}" https://linearb.jfrog.io/linearb/api/npm/npm-local/auth/linearb >> .npmrc
34+
35+
- name: Install @linearb/gitstream-core@${{ env.VERSION }}
36+
run: npm install --save --save-exact @linearb/gitstream-core@${{ env.VERSION }}
37+
38+
- name: Run Format & Lint & Test & Build & Package
39+
run: npm run all
40+
41+
- name: Create PR for ${{ env.VERSION }}
42+
env:
43+
GH_TOKEN: ${{ github.token }}
44+
run: |
45+
echo -e "Bump \`@linearb/gitstream-core\` to \`${{ env.VERSION }}\`\n\n${{ inputs.description }}" > pr_description.txt
46+
git config --global user.name 'GitHub Actions Bot'
47+
git config --global user.email 'actions@github.com'
48+
git add package.json package-lock.json dist/index.js
49+
git commit -m "bump `@linearb/gitstream-core` to `${{ env.VERSION }}`" -m "${{ inputs.description }}"
50+
git push origin HEAD:${{ env.BRANCH_NAME }}
51+
gh pr create \
52+
--base develop \
53+
--title "Bump \`@linearb/gitstream-core\` to \`${{ env.VERSION }}\`" \
54+
--body-file pr_description.txt \
55+
--head ${{ env.BRANCH_NAME }} \
56+
--reviewer ${{ github.actor }}

.github/workflows/check-dist.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ name: Check Transpiled JavaScript
33
on:
44
pull_request:
55
branches:
6-
- v2-develop
6+
- develop
77
push:
88
branches:
9-
- v2-develop
9+
- develop
1010

1111
permissions:
1212
contents: read

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ name: Continuous Integration
33
on:
44
pull_request:
55
branches:
6-
- v2-develop
6+
- develop
77
push:
88
branches:
9-
- v2-develop
9+
- develop
1010

1111
permissions:
1212
contents: read

.github/workflows/codeql-analysis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ name: CodeQL
33
on:
44
pull_request:
55
branches:
6-
- v2-develop
6+
- develop
77
push:
88
branches:
9-
- v2-develop
9+
- develop
1010
schedule:
1111
- cron: '0 7 * * 0' # At 07:00 on Sunday
1212

action.yml

Lines changed: 59 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ runs:
4242
- name: Create GitStream folder
4343
shell: bash
4444
run: |
45-
rm -rf gitstream && mkdir gitstream
45+
rm -rf gitstream && rm -rf code && mkdir gitstream
4646
cd gitstream && mkdir repo
4747
4848
- name: Checkout base branch
@@ -83,7 +83,50 @@ runs:
8383
process.exit(1);
8484
}
8585
86+
- name: Get condition variables
87+
uses: actions/github-script@v7
88+
env:
89+
IS_NON_COMMIT_ARG: ${{ fromJSON(fromJSON(inputs.client_payload)).isNonCommitEvent }}
90+
ENABLE_CACHE_ARG: ${{ env.ENABLE_CACHE }}
91+
RUN_ID_ARG: ${{ fromJSON(fromJSON(inputs.client_payload)).artifactRunId }}
92+
with:
93+
script: |
94+
require('${{ github.action_path }}/scripts/get-condition-vars.js')(core);
95+
96+
- name: Download cache artifact for cm repo
97+
id: download-cache-for-cm-repo
98+
uses: actions/download-artifact@v4
99+
if: ${{ env.SKIP_GIT_CLONE == 'true' && fromJSON(fromJSON(inputs.client_payload)).hasCmRepo == true }}
100+
continue-on-error: true
101+
with:
102+
github-token: ${{ fromJSON(fromJSON(inputs.client_payload)).githubToken || github.token }}
103+
repository: '${{ fromJSON(fromJSON(inputs.client_payload)).owner }}/${{ fromJSON(fromJSON(inputs.client_payload)).cmRepo }}'
104+
run-id: ${{ fromJSON(fromJSON(inputs.client_payload)).artifactRunId }}
105+
name: output
106+
path: code/output
107+
108+
- name: Download cache artifact when cmRepo is false
109+
id: download-cache
110+
uses: actions/download-artifact@v4
111+
if: ${{ env.SKIP_GIT_CLONE == 'true' && fromJSON(fromJSON(inputs.client_payload)).hasCmRepo == false}}
112+
continue-on-error: true
113+
with:
114+
github-token: ${{ fromJSON(fromJSON(inputs.client_payload)).githubToken || github.token }}
115+
repository: ${{ inputs.full_repository }}
116+
run-id: ${{ fromJSON(fromJSON(inputs.client_payload)).artifactRunId }}
117+
name: output
118+
path: code/output
119+
120+
- name: Check if download cache artifact failed
121+
uses: actions/github-script@v7
122+
env:
123+
ARTIFACT_OUTCOME_ARG: ${{ steps.download-cache.outcome }}
124+
ARTIFACT_OUTCOME_CM_REPO_ARG: ${{ steps.download-cache-for-cm-repo.outcome }}
125+
with:
126+
script: require('${{ github.action_path }}/scripts/check-cache-download-status')(core);
127+
86128
- name: Checkout Pull Request branches history
129+
if: ${{ env.SKIP_GIT_CLONE == 'false' || env.CACHE_DOWNLOAD_FAILED == 'true' }}
87130
shell: bash
88131
run: |
89132
ALL=1
@@ -96,12 +139,13 @@ runs:
96139
git checkout $'${{ steps.safe-strings.outputs.head_ref }}'
97140
98141
- name: Create cm folder
142+
if: ${{ env.SKIP_GIT_CLONE == 'false' || env.CACHE_DOWNLOAD_FAILED == 'true' }}
99143
shell: bash
100144
run: cd gitstream && mkdir cm
101145

102146
- name: Checkout cm repo
103147
uses: actions/checkout@v4
104-
if: ${{ fromJSON(fromJSON(inputs.client_payload)).hasCmRepo == true }}
148+
if: ${{ fromJSON(fromJSON(inputs.client_payload)).hasCmRepo == true && (env.SKIP_GIT_CLONE == 'false' || env.CACHE_DOWNLOAD_FAILED == 'true')}}
105149
with:
106150
repository: '${{ fromJSON(fromJSON(inputs.client_payload)).owner }}/${{ fromJSON(fromJSON(inputs.client_payload)).cmRepo }}'
107151
ref: ${{ fromJSON(fromJSON(inputs.client_payload)).cmRepoRef }}
@@ -113,7 +157,7 @@ runs:
113157

114158
- name: Install Dependencies for plugins
115159
shell: bash
116-
run: npm i --silent moment lodash axios @octokit/rest
160+
run: npm i --silent moment lodash axios @octokit/rest@20.1.1
117161

118162
- name: Run RulesEngine
119163
shell: bash
@@ -125,3 +169,15 @@ runs:
125169
RULES_RESOLVER_URL: ${{ inputs.resolver_url }}
126170
RULES_RESOLVER_TOKEN: ${{ inputs.resolver_token }}
127171
DEBUG_MODE: ${{ inputs.debug_mode }}
172+
SHOULD_SKIP_CLONE: ${{ env.SKIP_GIT_CLONE == 'true' && env.CACHE_DOWNLOAD_FAILED == 'false'}}
173+
ENABLE_CACHE: ${{ env.ENABLE_CACHE }}
174+
ENABLE_DEBUG_ARTIFACTS: ${{ env.ENABLE_DEBUG_ARTIFACTS }}
175+
RUN_ID: ${{ github.run_id }}
176+
177+
- name: Upload artifacts
178+
if: ${{ env.ENABLE_DEBUG_ARTIFACTS == 'true' || env.ENABLE_CACHE == 'true' }}
179+
uses: actions/upload-artifact@v4
180+
with:
181+
retention-days: 7
182+
name: output
183+
path: code/output

dist/index.js

Lines changed: 33 additions & 33 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/licenses.txt

Lines changed: 0 additions & 38 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)