Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 13 additions & 7 deletions .github/workflows/sync-cli-help-to-user-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,29 @@ jobs:
with:
repository: snyk/user-docs
path: user-docs
fetch-depth: 0
ref: main

- name: Checkout cli repository
uses: actions/checkout@v4
with:
repository: snyk/cli
ref: ${{ github.ref_name }}
path: cli
token: ${{ secrets.GITHUB_TOKEN }}
fetch-depth: 0
ref: ${{ github.ref_name }}

- name: Configure git user
- name: Configure Git user
run: |
git config --global user.email "noreply@snyk.io"
git config --global user.name "Team CLI Bot"
git config --global user.email "team-cli@snyk.io"

# GITHUB_ACTOR: The name of the person or app that initiated the workflow.
git config --global user.name "$GITHUB_ACTOR"
- name: Import and configure GPG
run: |
echo "$GPG_KEY" | gpg --batch --import
gpg --pinentry-mode loopback --passphrase "$GPG_PASSPHRASE" --batch --sign
env:
GPG_KEY: ${{ secrets.TEAM_CLI_BOT_GPG_KEY }}
GPG_PASSPHRASE: ${{ secrets.TEAM_CLI_BOT_GPG_PASSPHRASE }}

- name: Create or checkout destination branch
run: |
Expand Down Expand Up @@ -79,7 +85,7 @@ jobs:
run: |
cd ./cli
git add help
git commit -m "${{ env.COMMIT_MESSAGE }}"
git commit -S -m "${{ env.COMMIT_MESSAGE }}"
git push --force --set-upstream origin ${{ env.DESTINATION_BRANCH }}

- name: Create or update a pull request
Expand Down
23 changes: 15 additions & 8 deletions .github/workflows/sync-cli-readme.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,29 @@ jobs:
with:
repository: snyk/user-docs
path: user-docs
fetch-depth: 0
ref: main

- name: Checkout cli repository
uses: actions/checkout@v4
with:
repository: snyk/cli
path: cli
token: ${{ secrets.GITHUB_TOKEN }}
fetch-depth: 0
ref: main

- name: Configure git user
- name: Configure Git user
run: |
git config --global user.email "noreply@snyk.io"
git config --global user.name "Team CLI Bot"
git config --global user.email "team-cli@snyk.io"

# GITHUB_ACTOR: The name of the person or app that initiated the workflow.
git config --global user.name "$GITHUB_ACTOR"
- name: Import and configure GPG
run: |
echo "$GPG_KEY" | gpg --batch --import
gpg --pinentry-mode loopback --passphrase "$GPG_PASSPHRASE" --batch --sign
env:
GPG_KEY: ${{ secrets.TEAM_CLI_BOT_GPG_KEY }}
GPG_PASSPHRASE: ${{ secrets.TEAM_CLI_BOT_GPG_PASSPHRASE }}

- name: Create or checkout destination branch
run: |
Expand All @@ -49,7 +56,7 @@ jobs:

- name: Retrieve GitBook content and update README
run: |
cp ./docs/snyk-cli/getting-started-with-the-snyk-cli.md ./cli/README.md
cp ./user-docs/docs/snyk-cli/getting-started-with-the-snyk-cli.md ./cli/README.md

# GitBook Markdown files often use relative paths for assets (e.g., images)
# like `../.gitbook/assets/image.png`. When this README.md is viewed directly
Expand Down Expand Up @@ -89,8 +96,8 @@ jobs:
if: steps.check_changes.outputs.continue == 'true'
run: |
cd ./cli
git add help
git commit -m "${{ env.COMMIT_MESSAGE }}"
git add README.md
git commit -S -m "${{ env.COMMIT_MESSAGE }}"
git push --force --set-upstream origin ${{ env.DESTINATION_BRANCH }}

- name: Create or update a pull request
Expand Down