Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 10 additions & 13 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Dependabot configuration for AI-Pulse
# Auto-updates dependencies 2x per day with auto-merge
# Auto-updates dependencies 2x per day with security focus
# Author: ThePhoenixAgency
# Security: Ensures 0 vulnerabilities through automated updates

Expand All @@ -13,10 +13,10 @@ updates:
interval: "daily"
time: "06:00"
timezone: "UTC"
# Auto-merge security and patch updates silently
# Security-focused update strategy
open-pull-requests-limit: 10
reviewers: [] # No reviewers needed - auto-merge enabled
assignees: [] # No assignees - fully automated
reviewers:
- "ThePhoenixAgency"
labels:
- "dependencies"
- "auto-merge"
Expand All @@ -25,8 +25,8 @@ updates:
versioning-strategy: "increase"
# Commit message prefix
commit-message:
prefix: "deps"
prefix-development: "deps-dev"
prefix: "chore: "
prefix-development: "chore: "
include: "scope"
# Allow both direct and indirect updates
allow:
Expand All @@ -40,14 +40,11 @@ updates:
time: "18:00"
timezone: "UTC"
open-pull-requests-limit: 5
reviewers:
- "ThePhoenixAgency"
labels:
- "github-actions"
- "auto-merge"
commit-message:
prefix: "ci"

# Security notes:
# - All updates are security-focused
# - Auto-merge via GitHub Actions workflow
# - No email notifications (silent operation)
# - Zero manual intervention required
prefix: "ci: "
include: "scope"
151 changes: 151 additions & 0 deletions .github/workflows/dependencies-auto-securite.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
name: Auto Dependencies to Securite Branch

on:
pull_request:
types: [opened, synchronize]
paths:
- 'package.json'
- 'package-lock.json'
- '.github/workflows/**'

permissions:
contents: write
pull-requests: write
issues: write

jobs:
auto-merge-to-securite:
runs-on: ubuntu-latest
if: ${{ startsWith(github.head_ref, 'dependabot/') || contains(github.head_ref, 'dependencies') }}

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Ensure securite branch exists
run: |
git fetch origin securite 2>/dev/null || git switch --create securite
git push origin securite || true

Comment on lines +29 to +31
Copy link

Copilot AI Jan 8, 2026

Choose a reason for hiding this comment

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

The command git fetch origin securite 2>/dev/null || git switch --create securite has a logic issue. If the fetch fails (branch doesn't exist on remote), it creates a local branch, but then the git push origin securite || true on line 30 might push an unintended branch. This could create a securite branch based on the wrong base branch. Consider fetching from origin first, checking if the branch exists, and if not, creating it from a specific base branch like main.

Suggested change
git fetch origin securite 2>/dev/null || git switch --create securite
git push origin securite || true
# Fetch main and securite refs from origin
git fetch origin main securite || true
# Check if the securite branch exists on the remote
if git ls-remote --exit-code --heads origin securite >/dev/null 2>&1; then
# Ensure we have a local securite branch tracking origin/securite
if git show-ref --verify --quiet refs/heads/securite; then
git switch securite
else
git switch --track -c securite origin/securite
fi
else
# Create securite from main explicitly if it does not exist yet
git switch main || git switch origin/main
git switch --create securite
git push -u origin securite
fi

Copilot uses AI. Check for mistakes.
- name: Merge dependabot changes to securite branch
run: |
git config --global user.name 'ThePhoenixAgency'
git config --global user.email '${{ secrets.GIT_AUTHOR_EMAIL }}'
Copy link

Copilot AI Jan 8, 2026

Choose a reason for hiding this comment

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

If the GIT_AUTHOR_EMAIL secret is not set or is empty, the git config command will set an empty email, which will cause git operations to fail. Consider adding validation to ensure the secret exists and has a valid value, or provide a fallback default email.

Copilot uses AI. Check for mistakes.

# Fetch the PR branch
git fetch origin ${{ github.head_ref }}:${{ github.head_ref }} || true

# Switch to securite and merge
git switch securite
git merge origin/${{ github.head_ref }} --no-edit || true
Comment on lines +38 to +42

Choose a reason for hiding this comment

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

P1 Badge Merge the fetched PR branch instead of origin/*

The fetch step creates/updates a local branch with git fetch origin ${{ github.head_ref }}:${{ github.head_ref }}, but the merge uses origin/${{ github.head_ref }}. On pull_request runs, actions/checkout does not fetch that remote-tracking ref, so origin/<head_ref> is typically missing or stale. Because the merge error is silenced with || true, the job proceeds to push securite without the PR changes. This means Dependabot updates won’t actually land in securite in the common case. Merge the local branch (${{ github.head_ref }}) or fetch into refs/remotes/origin/<head_ref> before merging.

Useful? React with 👍 / 👎.

Copy link

Copilot AI Jan 8, 2026

Choose a reason for hiding this comment

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

The command uses || true which suppresses all errors, including legitimate ones like authentication failures or network issues. This makes debugging difficult and could hide real problems. Consider removing the || true or at least logging the error before suppressing it.

Suggested change
git merge origin/${{ github.head_ref }} --no-edit || true
git merge origin/${{ github.head_ref }} --no-edit

Copilot uses AI. Check for mistakes.

# Push to securite
git push origin securite

- name: Auto-approve dependabot PR
if: ${{ github.actor == 'dependabot[bot]' || startsWith(github.head_ref, 'dependabot/') }}
run: |
echo "Dependabot PR detected and merged to securite branch"

create-pr-to-main:
needs: auto-merge-to-securite
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: securite
fetch-depth: 0

- name: Check if PR already exists
id: check-pr
run: |
# Get list of open PRs from securite to main
PR_COUNT=$(gh pr list --base main --head securite --state open --json number | jq 'length')
echo "pr_count=$PR_COUNT" >> $GITHUB_OUTPUT
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Create PR from securite to main
if: steps.check-pr.outputs.pr_count == '0'
Copy link

Copilot AI Jan 8, 2026

Choose a reason for hiding this comment

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

The check for PR count compares a string '0' instead of an integer. While this may work in shell, it's more reliable to compare as an integer. Consider changing the condition to use integer comparison or ensure the comparison is correct for your shell environment.

Suggested change
if: steps.check-pr.outputs.pr_count == '0'
if: ${{ fromJSON(steps.check-pr.outputs.pr_count) == 0 }}

Copilot uses AI. Check for mistakes.
run: |
git config --global user.name 'ThePhoenixAgency'
git config --global user.email '${{ secrets.GIT_AUTHOR_EMAIL }}'
Copy link

Copilot AI Jan 8, 2026

Choose a reason for hiding this comment

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

If the GIT_AUTHOR_EMAIL secret is not set or is empty, the git config command will set an empty email, which will cause git operations to fail. Consider adding validation to ensure the secret exists and has a valid value, or provide a fallback default email.

Copilot uses AI. Check for mistakes.
Copy link
Member Author

Choose a reason for hiding this comment

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

@copilot open a new pull request to apply changes based on this feedback


# Check if there are new commits on securite not in main
NEW_COMMITS=$(git log main..securite --oneline | wc -l)

if [ "$NEW_COMMITS" -gt 0 ]; then
gh pr create \
--base main \
--head securite \
--title "chore: dependency updates" \
--body "Automated dependency and package updates from automated tools.

## Changes
This PR includes automatic dependency updates validated in the securite branch.

## Security
All dependency updates have been vetted for security vulnerabilities.

## Testing
- [ ] Dependencies properly installed
- [ ] No breaking changes detected
- [ ] Application runs without errors" \
--label "dependencies" \
--label "automated" || echo "PR already exists"
fi
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

check-interdependencies:
runs-on: ubuntu-latest
if: ${{ contains(github.event.pull_request.labels.*.name, 'dependencies') || startsWith(github.head_ref, 'dependabot/') }}

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'

- name: Check for dependency conflicts
id: check-conflicts
run: |
npm install --prefer-offline --no-audit 2>&1 | tee install.log || true

if grep -q "ERR!" install.log; then
echo "has_conflicts=true" >> $GITHUB_OUTPUT
echo "conflict_details=$(cat install.log)" >> $GITHUB_OUTPUT
else
echo "has_conflicts=false" >> $GITHUB_OUTPUT
fi

- name: Create issue for interdependency problems
if: steps.check-conflicts.outputs.has_conflicts == 'true'
run: |
gh issue create \
--title "⚠️ Dependency Interdependency Issue Detected" \
--body "A dependency conflict has been detected in the automated update process.

## Details
\`\`\`
${{ steps.check-conflicts.outputs.conflict_details }}
Copy link

Copilot AI Jan 8, 2026

Choose a reason for hiding this comment

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

The reference to steps.check-conflicts.outputs.conflict_details will not work correctly because the output was set using command substitution with potentially multi-line content. This will cause the issue body to be malformed or incomplete. Store the conflict details in a file instead and read from it when creating the issue.

Copilot uses AI. Check for mistakes.
Copy link
Member Author

Choose a reason for hiding this comment

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

@copilot open a new pull request to apply changes based on this feedback

Copy link
Member Author

Choose a reason for hiding this comment

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

@copilot open a new pull request to apply changes based on this feedback

Copy link
Member Author

Choose a reason for hiding this comment

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

@copilot open a new pull request to apply changes based on this feedback

Copy link
Member Author

Choose a reason for hiding this comment

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

@copilot open a new pull request to apply changes based on this feedback

\`\`\`

## Action Required
Please review the dependency conflicts and resolve manually if needed.

## Notification
Contact: ${{ secrets.GIT_AUTHOR_EMAIL }}" \
--label "bug" \
--label "dependencies" || echo "Issue creation skipped"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6 changes: 4 additions & 2 deletions .github/workflows/update-ai-pulse.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,13 @@ jobs:
rm -rf README.md && mv NEW-README.md README.md

- name: Commit and push changes
env:
GIT_AUTHOR_EMAIL: ${{ secrets.GIT_AUTHOR_EMAIL }}
run: |
Copy link

Copilot AI Jan 8, 2026

Choose a reason for hiding this comment

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

If the GIT_AUTHOR_EMAIL secret is not set or is empty, the git config command will set an empty email, which could cause git operations to fail. Consider adding validation to ensure the secret exists and has a valid value before using it, or provide a fallback default email.

Suggested change
run: |
run: |
if [ -z "${GIT_AUTHOR_EMAIL}" ]; then
echo "GIT_AUTHOR_EMAIL is not set or empty; using default GitHub Actions bot email."
GIT_AUTHOR_EMAIL="github-actions[bot]@users.noreply.github.com"
fi

Copilot uses AI. Check for mistakes.
git config --global user.name 'ThePhoenixAgency'
git config --global user.email 'phoenix.project@outlook.fr'
git config --global user.email "${GIT_AUTHOR_EMAIL}"
git add .

if ! git diff --cached --exit-code; then
UTC_DATE=$(date -u +'%a %b %d %H:%M:%S UTC %Y')
git commit -m "Updated AI-Pulse: $UTC_DATE"
Expand Down
11 changes: 6 additions & 5 deletions src/aggregator.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ function sanitizeArticle(article, sourceName, tags, category) {
source: sourceName,
tags: tags,
category: article.categories?.[0] || 'General',
summary: smartTruncate(rawSummary, 500) // Increased from 300 to 500 with smart truncation
summary: smartTruncate(rawSummary, 600) // Increased to 600 with smart truncation for better article previews
};
}

Expand Down Expand Up @@ -283,10 +283,11 @@ async function main() {
const readme = generateREADME(categorizedArticles);
console.log(readme);

// Auto-post top AI article to LinkedIn (optional)
if (categorizedArticles.ai?.length > 0) {
await postToLinkedIn(categorizedArticles.ai[0]);
}
// Auto-post top AI article to LinkedIn (PAUSED - articles not working yet)
// TODO: Re-enable when article fetching is fixed
// if (categorizedArticles.ai?.length > 0) {
// await postToLinkedIn(categorizedArticles.ai[0]);
// }

console.log('\n✅ Aggregation complete!');
}
Expand Down
Loading