Skip to content

Commit fe5153a

Browse files
authored
Merge branch 'main' into update_jfrog_docs
2 parents 43a087d + 07c7bc8 commit fe5153a

File tree

652 files changed

+5246
-1268
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

652 files changed

+5246
-1268
lines changed

.github/workflows/repo-sync.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,15 @@ jobs:
2828
- name: Sync repo to branch
2929
uses: repo-sync/github-sync@3832fe8e2be32372e1b3970bbae8e7079edeec88
3030
with:
31-
source_repo: https://${{ secrets.DOCS_BOT_PAT_BASE }}@github.com/github/${{ github.repository == 'github/docs-internal' && 'docs' || 'docs-internal' }}.git
31+
source_repo: https://${{ secrets.DOCS_BOT_PAT_REPO_SYNC }}@github.com/github/${{ github.repository == 'github/docs-internal' && 'docs' || 'docs-internal' }}.git
3232
source_branch: main
3333
destination_branch: repo-sync
34-
github_token: ${{ secrets.DOCS_BOT_PAT_BASE }}
34+
github_token: ${{ secrets.DOCS_BOT_PAT_REPO_SYNC }}
3535

3636
- name: Ship pull request
3737
uses: actions/github-script@e69ef5462fd455e02edcaf4dd7708eda96b9eda0
3838
with:
39-
github-token: ${{ secrets.DOCS_BOT_PAT_BASE }}
39+
github-token: ${{ secrets.DOCS_BOT_PAT_REPO_SYNC }}
4040
result-encoding: string
4141
script: |
4242
const { owner, repo } = context.repo

.github/workflows/sync-audit-logs.yml

Lines changed: 26 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -51,34 +51,38 @@ jobs:
5151
# Needed for gh
5252
GITHUB_TOKEN: ${{ secrets.DOCS_BOT_PAT_BASE }}
5353
run: |
54-
# If nothing to commit, exit now. It's fine. No orphans.
55-
changes=$(git diff --name-only | wc -l)
56-
untracked=$(git status --untracked-files --short | wc -l)
57-
filesChanged=$(git diff --name-only)
58-
# There will always be at least one file changed:
59-
# src/audit-logs/lib/config.json
60-
# If the config file is the only file changed, exit.
61-
if [[ $changes -eq 1 ]] && [[ $untracked -eq 1 ]] && [[ $filesChanged == *lib/config.json ]]; then
62-
echo "There are no changes to commit or untracked files. Exiting..."
54+
echo "Creating a new branch if needed..."
55+
branchname=audit-logs-schema-update-${{ steps.audit-log-allowlists.outputs.COMMIT_SHA }}
56+
remotesha=$(git ls-remote --heads origin $branchname)
57+
if [ -n "$remotesha" ]; then
58+
# output is not empty, it means the remote branch exists
59+
echo "Branch $branchname already exists in 'github/docs-internal'. Exiting..."
6360
exit 0
6461
fi
62+
git checkout -b $branchname
63+
echo "Created a new branch $branchname"
6564
65+
echo "Preparing commit..."
6666
git config --global user.name "docs-bot"
6767
git config --global user.email "[email protected]"
68+
git add -A .
69+
echo "Prepared commit"
6870
69-
branchname=audit-logs-schema-update-${{ steps.audit-log-allowlists.outputs.COMMIT_SHA }}
70-
71-
remotesha=$(git ls-remote --heads origin $branchname)
72-
if [ -n "$remotesha" ]; then
73-
# output is not empty, it means the remote branch exists
74-
echo "Branch $branchname already exists in 'github/docs-internal'. Exiting..."
71+
echo "Check if there are changes..."
72+
if git diff-index --cached --quiet HEAD -- . ':(exclude)src/audit-logs/lib/config.json'
73+
then
74+
echo "No real changes (only the SHA in config.json moved). Exiting…"
7575
exit 0
7676
fi
77+
echo "Changes detected, proceeding"
7778
78-
git checkout -b $branchname
79-
git add .
79+
echo "Creating commit..."
8080
git commit -m "Add updated audit log event data"
81+
echo "Created commit"
82+
83+
echo "Pushing commit..."
8184
git push origin $branchname
85+
echo "Pushed commit"
8286
8387
echo "Creating pull request..."
8488
gh pr create \
@@ -89,16 +93,21 @@ jobs:
8993
--repo github/docs-internal \
9094
--label audit-log-pipeline \
9195
--head=$branchname
96+
echo "Created pull request"
9297
9398
# can't approve your own PR, approve with Actions
99+
echo "Approving pull request..."
94100
unset GITHUB_TOKEN
95101
gh auth login --with-token <<< "${{ secrets.GITHUB_TOKEN }}"
96102
gh pr review --approve
103+
echo "Approved pull request"
97104
98105
# Actions can't merge the PR so back to docs-bot to merge the PR
106+
echo "Setting pull request to auto merge..."
99107
unset GITHUB_TOKEN
100108
gh auth login --with-token <<< "${{ secrets.DOCS_BOT_PAT_BASE }}"
101109
gh pr merge --auto
110+
echo "Set pull request to auto merge"
102111
103112
- uses: ./.github/actions/slack-alert
104113
if: ${{ failure() && github.event_name != 'workflow_dispatch' }}

.github/workflows/sync-openapi.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ jobs:
4848
# will be checked out
4949
repository: github/models-gateway
5050
path: models-gateway
51+
ref: main
52+
token: ${{ secrets.DOCS_BOT_PAT_BASE }}
5153

5254
- uses: ./.github/actions/node-npm-setup
5355

.github/workflows/triage-issue-comments.yml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,22 @@ jobs:
4747

4848
- uses: ./.github/actions/node-npm-setup
4949

50+
- name: Check issue exists
51+
id: exists
52+
env:
53+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
54+
ISSUE_URL: ${{ github.event.issue.html_url }}
55+
run: |
56+
if gh issue view $ISSUE_URL > /dev/null 2>&1
57+
then
58+
echo "exists=y" >> $GITHUB_OUTPUT
59+
else
60+
echo "exists=n" >> $GITHUB_OUTPUT
61+
fi
62+
5063
- name: Label issues with new comments with 'triage'
5164
uses: ./.github/actions/labeler
52-
if: ${{ steps.is-internal-contributor.outputs.result == 'false' }}
65+
if: ${{ steps.is-internal-contributor.outputs.result == 'false' && steps.exists.outputs.exists == 'y' }}
5366
with:
5467
addLabels: 'triage'
5568
ignoreIfLabeled: true
147 KB
Loading
51.3 KB
Loading
150 KB
Loading
42.1 KB
Loading
137 KB
Loading
119 KB
Loading

0 commit comments

Comments
 (0)