Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(workflows): open branch from dev not from main #861

Closed
Closed
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
6 changes: 5 additions & 1 deletion .github/workflows/check_outdated_dependencies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,16 @@ jobs:
with:
ref: "dev"

- name: Set ENV variable COMMIT_SHA
run: |
echo "COMMIT_SHA=$(git rev-parse HEAD)" >> $GITHUB_ENV

- name: Check workflow dependencies
uses: ./workflows/check_outdate_deps
env:
GITHUB_REPOSITORY: ${{ github.repository }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_SHA: ${{ secrets.GITHUB_SHA }}
COMMIT_SHA: ${{ env.COMMIT_SHA }}
REQUIREMENT_FILE: "requirements-workflow.txt"
OPEN_PR: "True"
OPEN_PR_BASE: "dev"
14 changes: 6 additions & 8 deletions workflows/check_outdate_deps/check_deps.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,12 @@

TOKEN = str(os.environ.get("GITHUB_TOKEN"))
REPOSITORY = str(os.environ.get("GITHUB_REPOSITORY"))
COMMIT_SHA = str(os.environ.get("GITHUB_SHA"))
COMMIT_SHA = str(os.environ.get("COMMIT_SHA"))
REQUIREMENT_FILE = str(os.environ.get("REQUIREMENT_FILE"))
HEADERS = {
"Authorization": f"token {TOKEN}",
"Accept": "application/vnd.github+json"
"Accept": "application/vnd.github+json",
"X-GitHub-Api-Version": "2022-11-28"
}
OPEN_PR = os.environ.get("OPEN_PR")
OPEN_PR_BASE = os.environ.get("OPEN_PR_BASE")
Expand Down Expand Up @@ -155,13 +156,10 @@ def update_branch_with_changes(branch, file_to_change):
git config --global user.email "dependencybot@linuxlab"
git config --global user.name "DependencyBot"
git fetch --prune
git stash push
git checkout -b {branch} origin/{branch}
git stash pop
git checkout --theirs {REQUIREMENT_FILE}
git add {file_to_change}
git checkout -b {branch}
git add --all
git commit --message=\"Update {file_to_change} on `date`\"
git push
git push --set-upstream origin {branch}
""")


Expand Down
Loading