Skip to content

debug

debug #27

name: Minutes 2 Github
env:
# customize the env variables below
MINUTES_URL_BASE: "https://pchampin.github.io/test_action/minutes" # without trailing slash
MINUTES_REPO_PATH: "minutes" # without trailing slash
M2G_CHANNEL: pmwg
M2G_GROUP: wg/pm
# IMPORTANT: you must also set up the secret M2G_TOKEN with a token authorized to comment on isses
M2G_TOKEN: ${{ secrets.M2G_TOKEN }}
# season to your taste
M2G_LOG_LEVEL: trace
on:
push:
branches:
- main
# paths:
# - ${{ format('{0}/*.html', env.MINUTES_REPO_PATH) }}
jobs:
minutes_to_gh:
runs-on: ubuntu-latest
steps:
- name: Checkout this repository
uses: actions/checkout@v2
with:
path: ./repo
fetch-depth: 0
- name: Debug
working-directory: ${{ format('./repo/{0}', env.MINUTES_REPO_PATH) }}
run: |
pwd
ls
echo ${{ format('{0}/*.html', env.MINUTES_REPO_PATH) }}
- name: Add list of new files to env
working-directory: ${{ format('./repo/{0}', env.MINUTES_REPO_PATH) }}
run: |
NEW_FILES=$(
git diff --name-status ${{ github.event.before }} ${{ github.event.after }} \
| grep '^A\s\+.*\.html$' \
| sed 's!^A\s\+!!'
)
echo -e "NEW_FILES=\n" $NEW_FILES
echo "NEW_FILES=$NEW_FILES" >> $GITHUB_ENV
- name: Set up Rust
if: ${{ env.NEW_FILES }}
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- name: Checkout minutes_to_gh
if: ${{ env.NEW_FILES }}
uses: actions/checkout@v2
with:
repository: pchampin/minutes_to_gh
path: ./m2g
- name: Build minutes_to_gh
if: ${{ env.NEW_FILES }}
working-directory: ./m2g
run: cargo build --verbose
- name: Run minutes_to_gh for each new file
if: ${{ env.NEW_FILES }}
working-directory: ./m2g
run: |
for FILE in $NEW_FILES; do
echo -------- $FILE
cargo run -- manual --file ../repo/$MINUTES_REPO_PATH/$FILE --url $MINUTES_URL_BASE/$FILE --transcript
done