Skip to content

Commit

Permalink
Abandoning the github actions workflow as it requires tokens to be cr…
Browse files Browse the repository at this point in the history
…eated for the other repository making it a potential risk
  • Loading branch information
TophrC-dd committed May 30, 2024
1 parent 8ad26a2 commit 638a841
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 32 deletions.
25 changes: 0 additions & 25 deletions .github/workflows/update_docs.yaml

This file was deleted.

21 changes: 14 additions & 7 deletions scripts/update_documentation.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,31 @@

GREEN="\033[0;32m"
NC="\033[0;0m"
DOCUMENTATION_REPO_PATH=$GITHUB_WORKSPACE/Dataog-documentation
DOCUMENTATION_REPO_PATH=$HOME/go/src/github.com/DataDog/documentation
DOCUMENTATION_FILE=./content/en/serverless/azure_app_services/azure_app_services_linux.md

function print_color {
printf "$GREEN$1$NC\n"
}

print_color "Creating a Github PR to update documentation"

if [ ! -d $DOCUMENTATION_REPO_PATH ]; then
print_color "Documentation directory does not exist, cloning into $DOCUMENTATION_REPO_PATH"
git clone [email protected]:TophrC-dd/documentation $DOCUMENTATION_REPO_PATH
fi

cd $DOCUMENTATION_REPO_PATH

# Make sure they don't have any local changes - this shouldn't happen as the file is checked out on action execution
# Make sure they don't have any local changes
if [ ! -z "$(git status --porcelain)" ]; then
print_color "Documentation directory is dirty -- please stash or save your changes and manually create the PR"
exit 1
fi

#Configuring a git user
git config --unset-all http.https://github.com/.extraheader
git config user.name github-actions
git config user.email [email protected]
print_color "Pulling latest changes from Github"
git checkout master
git pull

print_color "Checking out new branch that has version changes"
git checkout -b $USER/bump-aas-wrapper-version-$VERSION
Expand All @@ -37,7 +43,8 @@ git add $DOCUMENTATION_FILE
print_color "Creating commit -- please tap your Yubikey if prompted"
git commit -m "Bump AAS-WRAPPER to version $VERSION"
git push --set-upstream origin $USER/bump-aas-wrapper-version-$VERSION
dd-pr

# Reset documentation repo to clean a state that's tracking master
print_color "Resetting documentation git branch to master"
git checkout -B master origin/master
git checkout -B master origin/master

0 comments on commit 638a841

Please sign in to comment.