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

Change directory to the given path #563

Open
wants to merge 30 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
f382371
Change directory to the given path
kfcampbell Nov 15, 2023
cc5bb65
cd to path, then don't use it again
kfcampbell Nov 15, 2023
cc39817
Try committing index.js for testing purposes
kfcampbell Nov 15, 2023
3b06a4e
Fix assignment to constant
kfcampbell Nov 15, 2023
6a53ce5
Run build
kfcampbell Nov 15, 2023
d8f13e4
Use process.chdir to change directories
kfcampbell Nov 15, 2023
40b86ea
Swap out instances of GITHUB_REPOSITORY
kfcampbell Nov 15, 2023
4482a77
npm run build
kfcampbell Nov 15, 2023
5033609
Support path and pathToCdTo
kfcampbell Nov 17, 2023
7e7d5c3
Undo a whitespace change and add a log back
kfcampbell Nov 17, 2023
70ad867
Add spec for inputs
kfcampbell Nov 17, 2023
d5bf917
Reduce diff
kfcampbell Nov 17, 2023
0b42e40
Explicitly specify token permissions
kfcampbell Nov 17, 2023
b573e12
Try removing path parameter to simplify code path
kfcampbell Nov 28, 2023
081c9ca
Remove path from tests as well
kfcampbell Nov 28, 2023
8d78a8a
Try replacing gr2m with kfcampbell as assignee
kfcampbell Nov 28, 2023
86327ce
Remove team_reviewers test; this doesn't work in personal repos
kfcampbell Nov 28, 2023
61d08d0
Print out error in checkOutRemoteBranch
kfcampbell Dec 6, 2023
48a9801
Make sure owner is defined in checkOutRemoteBranch
kfcampbell Dec 6, 2023
709847b
Add back @gr2m for tests
kfcampbell Dec 6, 2023
c9af171
Add back path logic
kfcampbell Dec 6, 2023
6c3ffcf
Reduce diff in test.yml
kfcampbell Dec 6, 2023
3e17c8e
Remove redundant if statement
kfcampbell Dec 6, 2023
fe64f59
Whitespace changes
kfcampbell Dec 6, 2023
9340302
Add back dist/ to gitignore
kfcampbell Dec 6, 2023
645fcc1
Remove dist/index.js from git
kfcampbell Dec 6, 2023
434f5ef
Add back dist/index.js for use before official merge/release
kfcampbell Dec 6, 2023
d197c87
Refactor to support any base branch
kfcampbell Jul 12, 2024
42a7dac
Create base branch if it doesn't exist
kfcampbell Jul 12, 2024
08565f9
Create base branch from default branch SHA if it doesn't exist
kfcampbell Jul 12, 2024
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
15 changes: 10 additions & 5 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ async function main() {
if (!process.env.GITHUB_TOKEN) {
core.setFailed(
`GITHUB_TOKEN is not configured. Make sure you made it available to your action

uses: gr2m/create-or-update-pull-request-action@master
env:
GITHUB_TOKEN: \${{ secrets.GITHUB_TOKEN }}`
Expand Down Expand Up @@ -79,6 +79,11 @@ async function main() {
const DEFAULT_BRANCH = default_branch;
core.debug(`DEFAULT_BRANCH: ${DEFAULT_BRANCH}`);

if (inputs.path) {
core.debug(`Changing directory to ${inputs.path}`);
await runShellCommand(`cd ${inputs.path}`);
kfcampbell marked this conversation as resolved.
Show resolved Hide resolved
}

const { hasChanges } = await getLocalChanges(inputs.path);

if (!hasChanges) {
Expand Down Expand Up @@ -223,7 +228,7 @@ async function main() {
core.info(`Assignees added: ${assignees.join(", ")}`);
core.debug(inspect(data));
}

if (inputs.reviewers || inputs.team_reviewers) {
let params = {
owner,
Expand All @@ -233,8 +238,8 @@ async function main() {
let reviewers = null;
let team_reviewers = null;

if(inputs.reviewers) {
core.debug(`Adding reviewers: ${inputs.reviewers}`)
if(inputs.reviewers) {
core.debug(`Adding reviewers: ${inputs.reviewers}`)
reviewers = (inputs.reviewers || "").trim().split(/\s*,\s*/);

params = {
Expand All @@ -244,7 +249,7 @@ async function main() {
};

if(inputs.team_reviewers) {
core.debug(`Adding team reviewers: ${inputs.team_reviewers}`)
core.debug(`Adding team reviewers: ${inputs.team_reviewers}`)
team_reviewers = (inputs.team_reviewers || "").trim().split(/\s*,\s*/);

params = {
Expand Down