Skip to content

Commit

Permalink
chore: Skip CI for automated commits (#3760)
Browse files Browse the repository at this point in the history
* Use only title

* skip

* skip
  • Loading branch information
kdy1 committed Feb 27, 2022
1 parent 3c85a82 commit 36fcb6d
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 6 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/cargo.yml
Expand Up @@ -75,6 +75,8 @@ jobs:
test:
name: Test - ${{ matrix.settings.crate }} - ${{ matrix.settings.os }}
runs-on: ${{ matrix.settings.os }}
if: >-
${{ !contains(github.event.head_commit.message, 'chore: ') }}
strategy:
fail-fast: false
matrix:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/docs.yml
Expand Up @@ -10,6 +10,8 @@ jobs:
name: Rustdoc
concurrency: swc-docs-rustdoc
runs-on: macos-latest
if: >-
${{ !contains(github.event.head_commit.message, 'chore: ') }}
steps:
- uses: actions/checkout@v2
Expand Down
4 changes: 2 additions & 2 deletions scripts/bot/src/auto-rebase.ts
@@ -1,4 +1,4 @@
import { getLatestCommitMesssage } from "./util/git";
import { getTitleOfLatestCommit } from "./util/git";
import { octokit } from "./util/octokit";

// We only auto-rebase if the latest commit message is one of
Expand All @@ -10,7 +10,7 @@ const owner = 'swc-project';
const repo = 'swc';

(async () => {
const latestCommitMessage = await getLatestCommitMesssage();
const latestCommitMessage = await getTitleOfLatestCommit();

console.log(`Latest commit message: ${latestCommitMessage}`);

Expand Down
4 changes: 2 additions & 2 deletions scripts/bot/src/cargo/bump.ts
@@ -1,10 +1,10 @@
import { exec } from "child_process";
import { getLatestCommitMesssage } from "../util/git";
import { getTitleOfLatestCommit } from "../util/git";
import { parsePrComments } from "./comment-parser";


(async () => {
const latestCommitMessage = await getLatestCommitMesssage();
const latestCommitMessage = await getTitleOfLatestCommit();
console.log('Latest commit message:', latestCommitMessage);

const lParenIndex = latestCommitMessage.lastIndexOf('(#');
Expand Down
6 changes: 4 additions & 2 deletions scripts/bot/src/util/git.ts
Expand Up @@ -12,10 +12,12 @@ async function streamToString(stream: Stream): Promise<string> {



export async function getLatestCommitMesssage(): Promise<string> {
export async function getTitleOfLatestCommit(): Promise<string> {
const { stdout } = await exec('git log -1 --pretty=%B');

const msg = await streamToString(stdout!);

return msg.trim()
const s = msg.trim();

return s.split('\n')[0]
}

1 comment on commit 36fcb6d

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Benchmark

Benchmark suite Current: 36fcb6d Previous: 1865b6d Ratio
full_es2015 217094359 ns/iter (± 17035611) 171976777 ns/iter (± 4512206) 1.26
full_es2016 227560781 ns/iter (± 14505775) 153466134 ns/iter (± 27570016) 1.48
full_es2017 223907345 ns/iter (± 16834550) 151992706 ns/iter (± 5760593) 1.47
full_es2018 222055359 ns/iter (± 16663581) 150862769 ns/iter (± 11536912) 1.47
full_es2019 219877340 ns/iter (± 15923807) 175198257 ns/iter (± 30312350) 1.26
full_es2020 195100827 ns/iter (± 14131477) 156909309 ns/iter (± 6695779) 1.24
full_es3 276426030 ns/iter (± 37715959) 218187734 ns/iter (± 23133262) 1.27
full_es5 299752651 ns/iter (± 60439382) 218096594 ns/iter (± 17625836) 1.37
parser 930036 ns/iter (± 219488) 603698 ns/iter (± 21002) 1.54

This comment was automatically generated by workflow using github-action-benchmark.

Please sign in to comment.