This repository has been archived by the owner on Jun 25, 2024. It is now read-only.
generated from JupiterOne-Archives/integration-template
-
Notifications
You must be signed in to change notification settings - Fork 13
INT-8299: adding integration project support for auto
#599
Merged
Changes from 1 commit
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
4ad0520
INT-8299: adding intgration project support
sl45082 0a00553
Update for merge only
sl45082 ab67592
INT-8229: using env: instead of setOutPut
sl45082 88195a8
Merge branch 'INT-8229' of github.com:JupiterOne/graph-google-cloud i…
sl45082 71b46b6
INT-8229: fixing env var references
sl45082 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
name: J1 Google Cloud Integration deployment | ||
|
||
on: | ||
release: | ||
types: | ||
- published | ||
|
||
jobs: | ||
j1-integration-deployment: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Setup Node | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: 14.x | ||
- name: Get graph project, integration name and version number | ||
id: set_constants | ||
uses: actions/[email protected] | ||
with: | ||
script: | | ||
const tagName = context.payload.release.tag_name | ||
const versionNumber = tagName.replace("v", "") | ||
core.setOutput('versionNumber', versionNumber) | ||
core.setOutPut('integrationName', 'integration-google-cloud') | ||
core.setOutPut('graphProjectName', 'google-cloud') | ||
|
||
- name: Clone integration-google-cloud repository | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
token: ${{ secrets.AUTO_GITHUB_PAT_TOKEN }} | ||
repository: JupiterOne/${{ steps.set_constants.outputs.integrationName }} | ||
ref: main | ||
path: './${{ steps.set_constants.outputs.integrationName }}' | ||
- name: Set git config | ||
shell: bash | ||
working-directory: ./${{ steps.set_constants.outputs.integrationName }} | ||
run: | | ||
git config --local user.email "[email protected]" | ||
git config --local user.name "j1-internal-automation" | ||
- name: Clean up and create branch | ||
shell: bash | ||
working-directory: ./${{ steps.set_constants.outputs.integrationName }} | ||
run: | | ||
git reset --hard | ||
git checkout -b deploy-${{ steps.set_constants.outputs.integrationName }}-${{ steps.set_constants.outputs.versionNumber }} | ||
git push origin deploy-${{ steps.set_constants.outputs.integrationName }}-${{ steps.set_constants.outputs.versionNumber }} | ||
- name: Bump version in package.json and commit changes | ||
shell: bash | ||
working-directory: ./${{ steps.set_constants.outputs.integrationName }} | ||
run: | | ||
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_AUTH_TOKEN }}" > .npmrc | ||
yarn | ||
yarn upgrade @jupiterone/graph-${{ steps.set_constants.outputs.graphProjectName || steps.set_constants.outputs.integrationName }}@^${{ steps.set_constants.outputs.versionNumber }} | ||
git add . | ||
git commit -m "bump ${{ steps.set_constants.outputs.integrationName }} to version ${{ steps.set_constants.outputs.versionNumber }} deploy2dev" | ||
- name: Create Pull Request | ||
id: create_pull_request | ||
uses: peter-evans/create-pull-request@v4 | ||
with: | ||
token: ${{ secrets.AUTO_GITHUB_PAT_TOKEN }} | ||
path: ./${{ steps.set_constants.outputs.integrationName }} | ||
branch: deploy-${{ steps.set_constants.outputs.integrationName }}-${{ steps.set_constants.outputs.versionNumber }} | ||
base: main | ||
title: "[Github Action][${{ steps.set_constants.outputs.integrationName }}] - Deploy graph-${{ steps.set_constants.outputs.graphProjectName || steps.set_constants.outputs.integrationName }} v${{ steps.set_constants.outputs.versionNumber }}" | ||
body: | | ||
## Summary | ||
${{ github.event.release.body }} | ||
Pull request created by [Github action](integration-deployment.yml). | ||
PR to bump the version ${{ steps.set_constants.outputs.versionNumber }} for the integration ${{ steps.set_constants.outputs.integrationName }} | ||
- name: Enable Automerge | ||
if: steps.create_pull_request.outputs.pull-request-operation == 'created' | ||
shell: bash | ||
run: gh pr merge --squash --auto "${{ steps.create_pull_request.outputs.pull-request-url }}" | ||
sl45082 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
env: | ||
GH_TOKEN: ${{ secrets.AUTO_GITHUB_PAT_TOKEN }} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or to avoid using the deprecated core.setOutput more I would recommend removing these 2 lines and on line 8 using
and you can refer to them with
$IntegrationName
and$GraphProjectName
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks @Nick-NCSU , committing suggested changes.