1
0
mirror of https://github.com/joaquinjsb/gitea-release-please-action synced 2026-05-13 00:41:39 +02:00

fix: hot fix for permission issues in code suggester (#61)

This commit is contained in:
Benjamin E. Coe
2020-09-04 18:04:54 -07:00
committed by bcoe
parent 512c940c3a
commit 1b9bcd506c
2 changed files with 163 additions and 172 deletions

View File

@@ -20,7 +20,7 @@ Automate releases with Conventional Commit Messages.
release-please: release-please:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: GoogleCloudPlatform/release-please-action@v2.0.0 - uses: GoogleCloudPlatform/release-please-action@v2.1.0
with: with:
token: ${{ secrets.GITHUB_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }}
release-type: node release-type: node
@@ -105,7 +105,7 @@ jobs:
release-please: release-please:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: GoogleCloudPlatform/release-please-action@v2.0.0 - uses: GoogleCloudPlatform/release-please-action@v2.1.0
id: release id: release
with: with:
token: ${{ secrets.GITHUB_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }}

27
dist/index.js vendored
View File

@@ -43331,6 +43331,7 @@ async function existsBranchWithName(octokit, remote, name) {
const branches = (await octokit.repos.listBranches({ const branches = (await octokit.repos.listBranches({
owner: remote.owner, owner: remote.owner,
repo: remote.repo, repo: remote.repo,
per_page: 100
})).data; })).data;
const match = branches.some(branch => branch.name === name); const match = branches.some(branch => branch.name === name);
logger_1.logger.info(`Existing remote branch ${name} found on ${remote.owner}/${remote.repo}`); logger_1.logger.info(`Existing remote branch ${name} found on ${remote.owner}/${remote.repo}`);
@@ -43380,8 +43381,9 @@ async function branch(octokit, origin, upstream, name, baseBranch = DEFAULT_PRIM
return baseSha; return baseSha;
} }
catch (err) { catch (err) {
logger_1.logger.error('Error when creating branch'); // We only list 100 tags when checking for old branches, this means
throw err; // that we might miss some branches:
logger_1.logger.error('Error when creating branch');
} }
} }
exports.branch = branch; exports.branch = branch;
@@ -48287,22 +48289,11 @@ const logger_1 = __webpack_require__(148);
* @returns {Promise<RepoDomain>} the forked repository name, as well as the owner of that fork * @returns {Promise<RepoDomain>} the forked repository name, as well as the owner of that fork
*/ */
async function fork(octokit, upstream) { async function fork(octokit, upstream) {
try { // Fork does not work in a GitHub action environment, we should make this optional:
const forkedRepo = (await octokit.repos.createFork({ return {
owner: upstream.owner, owner: upstream.owner,
repo: upstream.repo, repo: upstream.repo
})).data; }
const origin = {
repo: forkedRepo.name,
owner: forkedRepo.owner.login,
};
logger_1.logger.info(`Create fork request was successful for ${origin.owner}/${origin.repo}`);
return origin;
}
catch (err) {
logger_1.logger.error('Error when forking');
throw Error(err.toString());
}
} }
exports.fork = fork; exports.fork = fork;
//# sourceMappingURL=fork-handler.js.map //# sourceMappingURL=fork-handler.js.map