Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
103 commits
Select commit Hold shift + click to select a range
94d4ace
push initial code
yurisasuke Jun 19, 2025
7bb27c5
Merge pull request #79 from TykTechnologies/initial-code-push
yurisasuke Jun 19, 2025
0ff7781
fix get started broken link
yurisasuke Jun 19, 2025
d4922eb
Merge pull request #82 from TykTechnologies/test-release-to-branches
yurisasuke Jun 19, 2025
ead5719
add release-bot (#84)
yurisasuke Jun 19, 2025
94f0560
Revert "fix get started broken link" (#88)
yurisasuke Jun 19, 2025
3a07377
remove footer (#90)
yurisasuke Jun 19, 2025
7edc5db
Update api-catalogue-not-found-error-developer-portal.mdx (#93)
yurisasuke Jun 20, 2025
7790ab7
Update release-bot.yaml (#96)
yurisasuke Jun 20, 2025
4f42a59
Update api-catalogue-not-found-error-developer-portal.mdx (#99)
yurisasuke Jun 20, 2025
74025cd
fix links (#102)
yurisasuke Jun 20, 2025
d7e96a4
add github actions for validation (#107)
yurisasuke Jun 20, 2025
09cf08b
fix-broken-images (#111)
yurisasuke Jun 20, 2025
8efb7d6
add merging by label (#114)
yurisasuke Jun 20, 2025
06c68c1
remove unesseary redirects (#119)
yurisasuke Jun 20, 2025
bd8d19f
fix issues (#123)
yurisasuke Jun 20, 2025
815e958
add defsult page (#128)
yurisasuke Jun 20, 2025
84fcb17
change how snippets are created (#133)
yurisasuke Jun 20, 2025
03144ed
add nav bar (#137)
yurisasuke Jun 20, 2025
3564d14
Update tyk-stack.mdx (#143)
yurisasuke Jun 20, 2025
0efc292
Update setup-email-notifications.mdx (#141)
yurisasuke Jun 20, 2025
a48eff6
Update outbound-email-configuration.mdx (#147)
letzya Jun 20, 2025
055b0f2
Update branches-config.json (#155)
yurisasuke Jun 20, 2025
d7de65e
Update bla.mdx (#163)
letzya Jun 20, 2025
3b4f744
add dispatch code (#166)
yurisasuke Jun 23, 2025
8410908
add mirror pr as draft (#172)
yurisasuke Jun 23, 2025
032eac1
Add auto merge (#179)
yurisasuke Jun 23, 2025
5785c1f
Revert "Add auto merge" (#182)
yurisasuke Jun 23, 2025
d07b6f1
auto-merge (#184)
yurisasuke Jun 23, 2025
abef7a2
change button color (#191)
yurisasuke Jun 24, 2025
b76fad1
add button color (#197)
yurisasuke Jun 24, 2025
f549b17
add squash merge (#203)
yurisasuke Jun 24, 2025
cbb1f42
fix cloud login link (#211)
letzya Jun 24, 2025
c86fd0c
rename script to a generic name (#214)
letzya Jun 25, 2025
bedf197
Letz fix braces (#216)
letzya Jun 25, 2025
b70fbfb
fix issue when we click update branch (#229)
yurisasuke Jun 25, 2025
4dfb834
Revert "fix issue when we click update branch" (#231)
yurisasuke Jun 25, 2025
0de22b9
fix cherry picking (#232)
yurisasuke Jun 25, 2025
f35f155
Revert "fix cherry picking" (#234)
yurisasuke Jun 25, 2025
40da59e
add github work flow release (#235)
yurisasuke Jun 25, 2025
1911cd9
Revert "add github work flow release" (#236)
yurisasuke Jun 25, 2025
1b998b0
old release revert (#237)
yurisasuke Jun 25, 2025
f583855
Update tyk-gateway-api.mdx (#226)
yurisasuke Jun 25, 2025
f1c8323
add release fix (#242)
yurisasuke Jun 25, 2025
64b44f7
Update apim.mdx (#251)
yurisasuke Jun 25, 2025
5e81e48
Update plan-your-api-integration.mdx (#248)
yurisasuke Jun 25, 2025
3a99d32
fix ci issue (#264)
yurisasuke Jun 25, 2025
3d1d34c
Letz vale (#218)
letzya Jun 25, 2025
5eb5062
Update tyk-gateway-api.mdx (#275)
yurisasuke Jun 25, 2025
0cdf8b0
Revert "Update tyk-gateway-api.mdx" (#288)
yurisasuke Jun 26, 2025
678fd79
fix merge docss (#286)
yurisasuke Jun 26, 2025
5909d6f
add validation (#294)
yurisasuke Jun 26, 2025
a18e491
add misisng images (#298)
yurisasuke Jun 26, 2025
d3bd5b7
Add border to button (#305)
yurisasuke Jun 26, 2025
56b5205
add link to data (#311)
yurisasuke Jun 26, 2025
84bf515
Update branches-config.json remove 5.9 (#315)
letzya Jun 26, 2025
2c3298d
add validation check (#319)
yurisasuke Jun 26, 2025
102212e
add thinkness 1.2 (#326)
yurisasuke Jun 26, 2025
799f1e1
Update apim.mdx (#337)
yurisasuke Jun 26, 2025
e9d60f7
add permisiion check (#342)
yurisasuke Jun 26, 2025
385f577
Revert "Update apim.mdx" (#346)
yurisasuke Jun 26, 2025
326ac17
Update overview.mdx (#349)
yurisasuke Jun 26, 2025
265b24e
fix table alighment (#360)
yurisasuke Jun 30, 2025
d9d5995
add no index (#367)
yurisasuke Jun 30, 2025
c2d5a74
remove ultiple h1 (#374)
yurisasuke Jun 30, 2025
7e6440d
add summary to release (#381)
yurisasuke Jul 1, 2025
1c4402d
rewrite summary (#387)
yurisasuke Jul 1, 2025
312f403
Revert "rewrite summary" (#393)
yurisasuke Jul 1, 2025
50752d1
add version (#400)
yurisasuke Jul 1, 2025
5f8f6d3
Update merge_docs_configs.py (#406)
yurisasuke Jul 2, 2025
92c099e
Update trigger-docs-deploy.yml (#414)
yurisasuke Jul 2, 2025
dec2c88
Update deploy-docs.yml (#420)
yurisasuke Jul 2, 2025
115f944
Update tyk-stack.mdx (#425)
yurisasuke Jul 2, 2025
e984ad6
Revert "Update tyk-stack.mdx" (#432)
yurisasuke Jul 2, 2025
5fa0898
add snippets fix (#438)
yurisasuke Jul 3, 2025
65dd5e9
fix-description (#444)
yurisasuke Jul 3, 2025
d441dbf
Update tyk-stack.mdx (#450)
yurisasuke Jul 3, 2025
8bc119d
Revert "Update tyk-stack.mdx" (#456)
yurisasuke Jul 3, 2025
2a46764
Update apim.mdx (#466)
yurisasuke Jul 3, 2025
d6bd188
Update tyk-cloud.mdx (#472)
yurisasuke Jul 3, 2025
c22650f
Update branches-config.json (#475)
yurisasuke Jul 3, 2025
8beea38
Revert "Update branches-config.json" (#479)
yurisasuke Jul 3, 2025
787da0b
Enabling the contextual menu in docs.json (#482)
letzya Jul 3, 2025
b8c98fb
add dark mode (#486)
yurisasuke Jul 4, 2025
750717b
Update tyk-cloud.mdx (#494)
yurisasuke Jul 4, 2025
d1f3487
Update merge_docs_configs.py (#496)
yurisasuke Jul 4, 2025
8bc1d8d
add add more options to docs.json (#500)
yurisasuke Jul 4, 2025
a503954
add sidebar (#504)
yurisasuke Jul 4, 2025
6a3ea1d
add change text color to white (#509)
yurisasuke Jul 4, 2025
dff88c8
add sec (#514)
yurisasuke Jul 4, 2025
497e00b
remove border (#519)
yurisasuke Jul 4, 2025
cf7d0bd
Update branches-config.json (#529)
yurisasuke Jul 7, 2025
102d74e
Update branches-config.json (#541)
yurisasuke Jul 8, 2025
a8115ac
Update branches-config.json (#552)
yurisasuke Jul 9, 2025
aa61be7
Update branches-config.json (#563)
yurisasuke Jul 10, 2025
1132e8d
remove comment (#570)
yurisasuke Jul 10, 2025
8cf8678
addpr-id-that-caused-a deployment (#575)
yurisasuke Jul 10, 2025
0905a90
Update tyk-stack.mdx (#578)
yurisasuke Jul 10, 2025
c939a91
Update deploy-docs.yml (#584)
yurisasuke Jul 10, 2025
a061313
Revert "Update tyk-stack.mdx" (#588)
yurisasuke Jul 10, 2025
da6f953
Revert "Update deploy-docs.yml" (#591)
yurisasuke Jul 10, 2025
3ba81ec
Update trigger-docs-deploy.yml (#595)
yurisasuke Jul 10, 2025
038f7ce
Update tyk-self-managed.mdx
yurisasuke Jul 10, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
26 changes: 26 additions & 0 deletions .github/test-events/issue_comment.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"action": "created",
"issue": {
"number": 234,
"pull_request": {
"url": "https://api.github.com/repos/TykTechnologies/tyk-docs/pulls/234"
}
},
"comment": {
"body": "/release to release-5.8",
"user": {
"login": "test-user"
}
},
"repository": {
"name": "mintlify-poc",
"full_name": "TykTechnologies/mintlify-poc",
"default_branch": "main",
"owner": {
"login": "TykTechnologies"
}
},
"sender": {
"login": "test-user"
}
}
271 changes: 193 additions & 78 deletions .github/workflows/deploy-docs.yml

Large diffs are not rendered by default.

66 changes: 26 additions & 40 deletions .github/workflows/mirror-pr-to-build-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,52 +28,38 @@ jobs:
# Create new mirror PR
echo "Creating new mirror PR..."

# Create PR body content
PR_BODY="**🔗 Auto-generated mirror PR for Mintlify preview**
# Create PR body content using printf to avoid shell parsing issues
printf '%s\n' \
"**🔗 Auto-generated mirror PR for Mintlify preview**" \
"" \
"**Original PR:** #${{ github.event.number }}" \
"**Author:** @${{ github.event.pull_request.user.login }}" \
"" \
"## Purpose" \
"This PR provides a Mintlify preview link for reviewing documentation changes." \
"" \
"## Preview Link" \
"The Mintlify preview will be available once this PR is processed." \
"" \
"## ⚠️ Important Notes" \
"- **Do not merge this PR directly**" \
"- This PR will be auto-merged when the original PR #${{ github.event.number }} is merged" \
"- Make all comments and reviews on the original PR #${{ github.event.number }}" \
"" \
"## Changes" \
"${{ github.event.pull_request.body }}" > pr_body.txt

**Original PR:** #${{ github.event.number }}
**Author:** @${{ github.event.pull_request.user.login }}
# Escape the title properly to handle special characters and spaces
ESCAPED_TITLE=$(printf '%s' "🔄 Preview: ${{ github.event.pull_request.title }}" | sed 's/"/\\"/g')

## Purpose
This PR provides a Mintlify preview link for reviewing documentation changes.

## Preview Link
The Mintlify preview will be available once this PR is processed.

## ⚠️ Important Notes
- **Do not merge this PR directly**
- This PR will be auto-merged when the original PR #${{ github.event.number }} is merged
- Make all comments and reviews on the original PR #${{ github.event.number }}

## Changes
${{ github.event.pull_request.body }}"

gh pr create \
--base production \
--head ${{ github.head_ref }} \
--title "🔄 Preview: ${{ github.event.pull_request.title }}" \
--body "$PR_BODY"
--head "${{ github.head_ref }}" \
--title "$ESCAPED_TITLE" \
--body-file pr_body.txt \
--draft

echo "✅ Mirror PR created successfully"

# Get the mirror PR number that was just created
MIRROR_PR=$(gh pr list --base production --head ${{ github.head_ref }} --json number --jq '.[0].number // empty')

# Comment on the original PR with link to mirror PR
if [ -n "$MIRROR_PR" ]; then
COMMENT_BODY="🔗 **Preview Link Available**

This PR has an auto-generated mirror for Mintlify preview:
👉 **[View Preview PR #$MIRROR_PR](https://github.com/${{ github.repository }}/pull/$MIRROR_PR)**

The Mintlify preview link will appear on the mirror PR once it's processed.

---
*This is an automated comment. All discussion should happen on this PR, not the mirror PR.*"

gh pr comment ${{ github.event.number }} --body "$COMMENT_BODY"
echo "✅ Comment added to original PR with mirror PR link"
fi
else
echo "🔄 Mirror PR #$MIRROR_PR already exists and will be auto-updated"
fi
Expand Down
189 changes: 189 additions & 0 deletions .github/workflows/release-bot.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,189 @@
name: Cherry-pick to Release Branch

on:
issue_comment:
types: [created]
workflow_call:

jobs:
cherry_pick:
runs-on: ubuntu-latest
steps:
- name: Check for release command
id: check_command
uses: actions/github-script@v6
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const { issue, comment } = context.payload;
if (!issue || !issue.pull_request || !comment || !comment.body.startsWith('/release to ')) {
core.setOutput('release_valid', 'false');
return;
}
const releaseBranch = comment.body.split('/release to ')[1].trim();
core.setOutput('release_valid', 'true');
core.setOutput('release_branch', releaseBranch);
core.setOutput('pr_number', issue.number);

- name: Check admin permissions
if: steps.check_command.outputs.release_valid == 'true'
uses: actions/github-script@v6
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const username = context.payload.comment.user.login;
const authorAssociation = context.payload.comment.author_association;

// Quick check: Repository owner always allowed
if (authorAssociation === 'OWNER') {
console.log(`✅ User ${username} is repository owner`);
return;
}

// Check for admin permission
try {
const { data: permission } = await github.rest.repos.getCollaboratorPermissionLevel({
owner: context.repo.owner,
repo: context.repo.repo,
username: username
});

if (permission.permission !== 'admin') {
core.setFailed(`❌ Only repository admins can use /release command. User ${username} has: ${permission.permission}`);
return;
}

console.log(`✅ User ${username} has admin permissions`);
} catch (error) {
core.setFailed(`❌ Permission check failed: ${error.message}`);
}

- name: Install GitHub CLI (for act/local testing)
if: steps.check_command.outputs.release_valid == 'true'
run: |
sudo apt update
sudo apt install -y curl unzip gnupg
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo tee /usr/share/keyrings/githubcli-archive-keyring.gpg >/dev/null
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null
sudo apt update
sudo apt install -y gh

- name: Checkout repository
if: steps.check_command.outputs.release_valid == 'true'
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set default branch variable
if: steps.check_command.outputs.release_valid == 'true'
run: echo "DEFAULT_BRANCH=${{ github.event.repository.default_branch }}" >> $GITHUB_ENV

- name: Skip jobs if not a valid release command
if: steps.check_command.outputs.release_valid == 'false'
run: echo "Skipping cherry-pick as the release command is not valid."
continue-on-error: true

- name: Setup Git
if: steps.check_command.outputs.release_valid == 'true'
run: |
git config --global user.email "bot@tyk.io"
git config --global user.name "Tyk Bot"

- name: Get PR base and merge SHAs
id: pr_details
if: steps.check_command.outputs.release_valid == 'true'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
PR_NUMBER=${{ steps.check_command.outputs.pr_number }}
MERGE_COMMIT=$(gh pr view "$PR_NUMBER" --json mergeCommit --jq '.mergeCommit.oid // empty')
BASE_SHA=$(gh pr view "$PR_NUMBER" --json baseRefOid --jq '.baseRefOid // empty')
echo "MERGE_COMMIT=$MERGE_COMMIT" >> $GITHUB_ENV
echo "BASE_SHA=$BASE_SHA" >> $GITHUB_ENV
echo "MERGE_COMMIT=$MERGE_COMMIT" >> $GITHUB_OUTPUT
echo "BASE_SHA=$BASE_SHA" >> $GITHUB_OUTPUT

- name: Cherry-pick PR into release branch
id: cherry_pick
if: steps.check_command.outputs.release_valid == 'true'
env:
GITHUB_TOKEN: ${{ secrets.ORG_GH_TOKEN }}
GITHUB_REPO: ${{ github.repository }}
GITHUB_BRANCH: ${{ steps.check_command.outputs.release_branch }}
run: |
export FOLDER=$(basename "$GITHUB_REPO")
rm -rf $FOLDER
git clone https://x-access-token:$GITHUB_TOKEN@github.com/$GITHUB_REPO
cd $FOLDER

git checkout $GITHUB_BRANCH
git pull

NEW_BRANCH=merge/$GITHUB_BRANCH/$MERGE_COMMIT
git branch -D $NEW_BRANCH 2>/dev/null || true
REMOTE_EXISTS=$(git ls-remote --heads origin $NEW_BRANCH | wc -l)
[ "$REMOTE_EXISTS" -gt 0 ] && git push origin --delete $NEW_BRANCH || true

git checkout -b $NEW_BRANCH

MERGE_FAILED=0
git cherry-pick -x $BASE_SHA..$MERGE_COMMIT || MERGE_FAILED=$?

git diff --quiet origin/$GITHUB_BRANCH HEAD && {
echo "No changes to cherry-pick"
echo "PR_URL=" >> $GITHUB_OUTPUT
echo "MERGE_FAILED=0" >> $GITHUB_OUTPUT
exit 0
}

git push origin $NEW_BRANCH --force

TITLE=$(git log --format=%s -n 1 $MERGE_COMMIT)
BODY=$(git log --format=%B -n 1 $MERGE_COMMIT)

PR_URL=$(gh pr create \
--title "Merging to $GITHUB_BRANCH: $TITLE" \
--body "$BODY" \
--repo $GITHUB_REPO \
--base $GITHUB_BRANCH \
--head $NEW_BRANCH \
$( [ "$MERGE_FAILED" -ne 0 ] && echo "--draft" ))

echo "PR_URL=$PR_URL" >> $GITHUB_OUTPUT
echo "MERGE_FAILED=$MERGE_FAILED" >> $GITHUB_OUTPUT

if [ "$MERGE_FAILED" -eq 0 ]; then
if [[ "$PR_URL" =~ /pull/([0-9]+) ]]; then
PR_NUMBER="${BASH_REMATCH[1]}"
gh pr merge --squash "$PR_NUMBER" --auto --subject "Merging to $GITHUB_BRANCH: $TITLE" --body "$BODY" || echo "Auto-merge failed"
fi
fi

- name: Comment back on original PR
if: steps.check_command.outputs.release_valid == 'true' && always()
uses: actions/github-script@v6
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const prUrl = '${{ steps.cherry_pick.outputs.PR_URL }}';
const mergeFailed = '${{ steps.cherry_pick.outputs.MERGE_FAILED }}' === '1';
let body;

if ('${{ job.status }}' === 'success') {
if (mergeFailed) {
body = `⚠️ Cherry-pick completed with conflicts. A draft PR was created: ${prUrl}`;
} else if (prUrl) {
body = `✅ Cherry-pick successful. A PR was created and auto-merged (if allowed): ${prUrl}`;
} else {
body = `ℹ️ Cherry-pick skipped: no changes needed in target branch.`;
}
} else {
body = '❌ Cherry-pick failed. Please check the workflow logs.';
}

github.rest.issues.createComment({
issue_number: ${{ steps.check_command.outputs.pr_number }},
owner: context.repo.owner,
repo: context.repo.repo,
body: body
});
Loading