ubiquity / ts-template

A template repository for all @ubiquity projects.
2 stars 24 forks source link

fix: Jest / Cypress now triggers after build, and release-please targets the main branch #45

Closed gentlementlegen closed 5 months ago

gentlementlegen commented 5 months ago

release-please would never run because I realized that $default-branch only works for Workflow templates, not the actual workflow.

Jest and Cypress now trigger on Build step completion, allowing them to access secrets and also post results in the PR.

github-actions[bot] commented 5 months ago
Lines Statements Branches Functions
Coverage: 80%
80% (4/5) 100% (0/0) 66.66% (2/3)

JUnit

Tests Skipped Failures Errors Time
1 0 :zzz: 0 :x: 0 :fire: 2.717s :stopwatch:
Coverage Report (80%)
File% Stmts% Branch% Funcs% LinesUncovered Line #s
All files8010066.6680 
   main.ts8010066.66809
ubiquity-os-deployer[bot] commented 5 months ago
16b3090
f19366e
f19366e
gentlementlegen commented 5 months ago

@0x4007 It is useful for starter workflows. But it only seems to work if you basically use the workflow as a template to create another one, not for template repositories like ts-template, where the value would remain as $default-branch, such as in assistive-pricing.

rndquu commented 5 months ago

@gentlementlegen So $default-branch works only for https://github.com/ubiquity/.github/tree/main/.github/workflows, right?

gentlementlegen commented 5 months ago

@rndquu From what I understand, GitHub action does not provide a way to put a default-branch at that stage of the workflow.

What $default-branch does:

Otherwise, there is another way: we can always run the Action on a push event, and skip the job of that branch if it is not the default one, because within the jobs it is possible to access the ref value and check if that is the main branch. Downside is that the Action triggers on every push event, and gets skipped at job level, so I thought it would make more sense to simply run on the main branch which should be our standard.