notion_image_upload_test #32
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: notion_image_upload_test | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '0 0 * * 6' # Runs at 8 AM Singapore time (00:00 UTC) every Saturday | |
jobs: | |
build: | |
runs-on: macos-15 | |
steps: | |
- name: Verify Runner Architecture (ARM64 Check) | |
run: | | |
ARCH=$(uname -m) | |
echo "Running on architecture: $ARCH" | |
if [[ "$ARCH" != "arm64" ]]; then | |
echo "❌ ERROR: This workflow requires an ARM-based Mac (M1/M2)." | |
exit 1 | |
fi | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
- name: Create Test Directory | |
run: mkdir -p notion-test/data-set | |
- name: Prepare Runnder Test Directories | |
run: | | |
PARENT=$( cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P ) | |
mkdir -p "$PARENT/notion-test/data-set/json" | |
- name: Copy Local Data Set Directories to Runnder Test Directories | |
run: | | |
mkdir -p notion-test/data-set | |
mkdir -p notion-test/data-set/json | |
cp -R ./test/json/. ./notion-test/data-set/json | |
- name: Verify Copied Files | |
run: | | |
echo "Checking copied files..." | |
ls -l ./notion-test/ | |
ls -l ./notion-test/data-set | |
ls -l ./notion-test/data-set/json | |
- name: Get CSV2Notion Neo Latest Release URL | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
LATEST_URL=$(curl -s -H "Authorization: token $GITHUB_TOKEN" https://api.github.com/repos/TheAcharya/csv2notion-neo/releases/latest | \ | |
jq -r '.assets[] | select(.name | endswith(".pkg")) | .browser_download_url') | |
if [ -z "$LATEST_URL" ]; then | |
echo "No .pkg asset found in the latest release." | |
exit 1 | |
fi | |
echo "Latest release URL: $LATEST_URL" | |
echo "DOWNLOAD_URL=$LATEST_URL" >> $GITHUB_ENV | |
- name: Download CSV2Notion Neo macOS Package | |
run: | | |
curl -L -o ./notion-test/CSV2Notion-Neo.pkg "$DOWNLOAD_URL" | |
- name: Install CSV2Notion Neo Package | |
run: | | |
sudo installer -pkg ./notion-test/CSV2Notion-Neo.pkg -target / | |
- name: Verify CSV2Notion Neo Installation | |
run: | | |
if ! command -v csv2notion_neo &> /dev/null | |
then | |
echo "❌ ERROR: CSV2Notion Neo is not installed or not in PATH." | |
exit 1 | |
fi | |
echo "✅ CSV2Notion Neo installed successfully!" | |
echo "Checking version..." | |
csv2notion_neo --version | |
- name: Run Image Upload Test with CSV2Notion Neo | |
env: | |
NOTION_WORKSPACE: ${{ secrets.NOTION_WS_V }} | |
NOTION_TOKEN: ${{ secrets.NOTION_TOKEN_V }} | |
NOTION_URL: ${{ secrets.NOTION_URL_V }} | |
run: | | |
PARENT=$( cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P ) | |
UPLOAD_PAYLOAD="$PARENT/notion-test/data-set/json/notion-upload-test.json" | |
echo "Running CSV2Notion Neo image upload test..." | |
csv2notion_neo --workspace "$NOTION_WORKSPACE" --token "$NOTION_TOKEN" --url "$NOTION_URL" --image-column "Image Filename" "Palette Filename" --image-column-keep --mandatory-column "Marker ID" --icon-column "Icon Image" --payload-key-column "Marker ID" --max-threads 10 --merge --verbose "$UPLOAD_PAYLOAD" |