Skip to content

Snap Cron

Snap Cron #107932

Workflow file for this run

name: Snap Cron
on:
push:
schedule:
- cron: '*/15 * * * *'
jobs:
check:
strategy:
fail-fast: false
matrix:
track: [main, 21, 20, 18]
name: Check branch
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: node${{ matrix.track }}
fetch-depth: 0
if: ${{ matrix.track != 'main' }}
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
if: ${{ matrix.track == 'main' }}
- name: Init git config
run: |
git config user.name "GitHub Actions"
git config user.email noreply@github.com
git remote add launchpad git+ssh://openjs@git.launchpad.net/node-snap
mkdir ~/.ssh/
chmod 700 ~/.ssh
echo "Host git.launchpad.net" > ~/.ssh/config
echo " User openjs" >> ~/.ssh/config
echo " IdentityFile ~/.ssh/launchpad_rsa" >> ~/.ssh/config
echo -e "${{ secrets.LAUNCHPAD_RSA }}" > ~/.ssh/launchpad_rsa
chmod 600 ~/.ssh/launchpad_rsa
# In ephemeral environments like GitHub Action runners, relying on TOFU isn't providing any security
# so require the key obtained by `ssh-keyscan` to match the expected hash from https://help.launchpad.net/SSHFingerprints
ssh-keyscan git.launchpad.net >> ~/.ssh/known_hosts
ssh-keygen -qlF git.launchpad.net | grep -xF 'git.launchpad.net RSA SHA256:UNOzlP66WpDuEo34Wgs8mewypV0UzqHLsIFoqwe8dYo'
- name: Sync Release
run: ./snapcraft.yaml.sh -r${{ matrix.track }} -gnode${{ matrix.track }}
if: ${{ matrix.track != 'main' }}
- name: Sync Edge
run: ./snapcraft.yaml.sh -gmain
if: ${{ matrix.track == 'main' }}